curlew.js
is a simple arguments parser in NodeJS.
npm install curlew.js --save
git clone https://github.com/Treast/curlew.js.git
mv ./curlew.js/curlew.js ./foo/bar
const arguments = require('curlew.js').init();'
// Called script: "node foo.js --firstKey firstValue --secondKey -a bar"
const defaults = {
key: 'value'
};
const arguments = require('curlew.js').init(defaults);
console.log(arguments);
/*
{
key: 'value',
firstKey: 'firstValue',
secondKey: true,
a: 'bar'
}
*/
Name | Informations |
---|---|
default(Object) |
Default values (optionnal) |