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

group-args

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

group-args

My praiseworthy module

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by12.19%
Maintainers
1
Weekly downloads
 
Created
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

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

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