Socket
Socket
Sign inDemoInstall

argue-cli

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    argue-cli

Node.js CLI arguments parser.


Version published
Weekly downloads
106K
decreased by-32.78%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

NPM

argue-cli

Node.js CLI arguments parser.

API

expect(...names)

Strict expectation one of given commands. Returns full variant of expected argument.

expect(
	{"install": "i"}, // full name and shirt name, e.g. `npm install`, `npm i` 
	["update", "u"],  // also full name and shirt name, e.g. `npm update`, `npm u`   
	"info"            // only one variant of name
);

read()

Strict reading of argument. Returns argument.

read(); // e.g. for `npm babel` returns "babel"

end()

Strict expectation of end.

end(); // e.g. for `npm babel` throws Error.

strictOptions(flagsNames, optionsNames)

Strict reading of flags and options. Returns fullname-value pairs object.

strictOptions([
    ["another"]      // for flags array is same as object notation
    "verbose"        // only one variant of name, e.g. `babel --verbose`
], [
    {"output": "o"}, // full name and shirt name, e.g. `babel --output ./main.js`, `babel -o ./main.js` 
    ["plugins", "p"] // fullname and shirtname for array, e.g. `babel --plugins commonjs,decorators`, `babel -p commonjs,decorators` 
])

strictOptionsEqual(...names)

Strict reading of options with equal sign. If option is provided without value it will interpreted as true. Returns fullname-value pairs object.

strictOptionsEqual(
    {"output": "o"}, // full name and shirt name, e.g. `babel --output=./main.js`, `babel -o=./main.js` 
    ["plugins", "p"] // fullname and shirtname for array, e.g. `babel --plugins=commonjs,decorators`, `babel -p=commonjs,decorators` 
    "verbose"        // only one variant of name, e.g. `babel --verbose`
)

options(flagsNames, optionsNames)

Unlimited reading of flags and options. Returns fullname-value pairs object.

options([
    ["another"]      // for flags array is same as object notation
    "verbose"        // only one variant of name, e.g. `babel compile script.js --verbose`
], [
    {"output": "o"}, // full name and shirt name, e.g. `babel compile script.js --output ./main.js`, `babel compile script.js -o ./main.js` 
    ["plugins", "p"] // fullname and shirtname for array, e.g. `babel --plugins commonjs,decorators compile script.js`, `babel -p commonjs,decorators compile script.js` 
])

optionsEqual(...names)

Unlimited reading of options with equal sign. If option is provided without value it will interpreted as true. Returns fullname-value pairs object.

optionsEqual(
    {"output": "o"}, // full name and shirt name, e.g. `babel compile script.js --output=./main.js`, `babel compile script.js -o=./main.js` 
    ["plugins", "p"] // fullname and shirtname for array, e.g. `babel --plugins=commonjs,decorators compile script.js`, `babel -p=commonjs,decorators compile script.js` 
    "verbose"        // only one variant of name, e.g. `babel compile script.js --verbose`
)

Keywords

FAQs

Last updated on 29 Jun 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