JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 25859
  • Score
    100M100P100Q151857F
  • License MIT

Expand parsed command line arguments using expand-object.

Package Exports

  • expand-args

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (expand-args) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

expand-args NPM version

Expand parsed command line arguments using expand-object.

Example

var minimist = require('minimist');
var expandArgs = require('expand-args');

var argv = minimist(['--set=a:b,c:d']);
//=> { _: [], set: 'a:b,c:d' }

expandArgs(argv);
//=> { _: [], set: [{ a: 'b' }, { c: 'd' }] }

Visit expand-objectto see the full range of options and features or to create expansion-related issues.

Install

Install with npm

$ npm i expand-args --save

Usage

var expandArgs = require('expand-args');

expand args to object values

expandArgs({set: 'a:b'})
//=> {set: {a: 'b'}}

expandArgs({set: 'a.b.c:d'})
//=> {set: {a: {b: {c: 'd'}}}}

expand args to array values

expandArgs({set: 'a:b,c:d'})
//=> {set: [{a: 'b'}, {c: 'd'}]}

expandArgs({set: 'a.b.c:d,e,f'})
//=> {set: {a: {b: {c: ['d', 'e', 'f']}}}}

fix object keys (mistakenly) set as booleans

expandArgs({'a:b': true})
//=> {a: 'b'}
  • expand-object: Expand a string into a JavaScript object using a simple notation. Use the CLI or… more
  • extend-shallow: Extend an object with the properties of additional objects. node.js/javascript util.

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on August 06, 2015.