JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26872
  • Score
    100M100P100Q140327F
  • 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 Build Status

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-object to see the full range of options and features or to create expansion-related issues.

Install

Install with npm:

$ npm install 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']}}}}

Convert "object-keys"

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

Expand booleans

expandArgs({set: 'a|b'});
//=> {set: {a: true, b: true}}

Running tests

Install dev dependencies:

$ npm install -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 © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb, v0.9.0, on April 09, 2016.