Socket
Socket
Sign inDemoInstall

group-args

Package Overview
Dependencies
2
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

group-args

My praiseworthy module


Version published
Maintainers
1
Weekly downloads
22,744
decreased by-5.7%

Weekly downloads

Readme

Source

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

Keywords

FAQs

Last updated on 20 Apr 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc