@nuff-said/args
v1.1.2
Published
A concise argument parser for JavaScript
Downloads
39
Readme
@nuff-said/args
A compact and efficient CLI argument parser that supports all major argument formats, all packed into a raw code size of just 378 bytes! 3.4x smaller than the minzipped size of the most popular option, minimist, albeit missing a few features.
Type checking and parsing are non-goals, as a schema parser is a dedicated tool that should be used to this end.
const parseArgs = require('@nuff-said/args');
console.log(parseArgs(process.argv.slice(2)));$ node index --bool=false --num 123 -ar -z false --test hey hey -x= -- --no -more -parse=ing
{
_: [ 'hey', '--no', '-more', '-parse=ing' ],
bool: 'false',
num: '123',
a: true,
r: true,
z: 'false',
test: 'hey',
x: ''
}Installation
$ npm i @nuff-said/argsContributing
All contributions are welcome! Feel free to file an issue, point out an optimization or even push a PR!
License
This project uses the GPL-3.0 license.
