🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
g

group-args

My praiseworthy module

0.1.0
latest
97

Supply Chain Security

100

Vulnerability

92

Quality

75

Maintenance

100

License

Version published
Weekly downloads
24K
3.98%
Maintainers
1
Weekly downloads
 
Created
Issues
0

group-args Build Status

CLI helper to group commandline arguments

Install

$ npm install --save group-args

Usage

node ./cli.js --foo --bar something --group-a 1 --group-b 2
const groupArgs = require('group-args');

// process.argv: [
groupArgs('group');
//=> {foo: true, bar: 'something', group: { a: 1, b: 2 }}

API

groupArgs(key, [options], [minimistOptions])

key

Type: string|array|object

Group arguments by key. When passing an object it is Could be 'key', ['key1','key2'], {alias1: 'key1', alias2: 'key2'}

options

argv

Type: array|object
Default: process.argv.slice(2)

Arguments array or already parsed arguments.

delimiter

Type: string
Default: -

Delimiter between group identifier & key.

strict

Type: bool
Default: true

Disable to allow camelCased arguments provided by e.g. meow

alias

Type: string
Default: undefined

Alias for identifier (short opt)

camelCase

Type: bool
Default: true

camelCase grouped arguments

minimistOptions

See minimist

License

MIT © Ben Zörb

FAQs

Package last updated on 20 Apr 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