Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expand-args

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expand-args

Expand parsed command line arguments using expand-object.

  • 0.3.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
31K
increased by5.25%
Maintainers
1
Weekly downloads
 
Created
Source

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 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']}}}}

Convert "object-keys"

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

Expand booleans

expandArgs({set: 'a|b'});
//=> {set: {a: true, b: true}}
  • expand-object: Expand a string into a JavaScript object using a simple notation. Use the CLI or… more | homepage
  • map-config: Map configuration objects to application methods. | homepage

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


This file was generated by verb on January 29, 2016.

Keywords

FAQs

Package last updated on 04 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc