1.0.0 • Published 7 years ago
params-cli v1.0.0
Easily extract CLI parameters when invoking your NodeJS script.
Instead of manually extracting parameters from process.argv, this package returns an object of parameters and values of your script invoke.
Install
$ npm install --save params-cliUsage
Suppose you have your script called app.js, with the following:
const params = require('params-cli');
console.log(params.script());
console.log(params.has('x'));
console.log(params.get('x'));
console.log(params.has('y'));
console.log(params.get('y'));Running your script with parameters returns the following:
$ node app.js x=abc123
/path/to/your/app.js
true
abc123
false
undefinedContributing
Make sure to not break tests, by running npm run test:watch.
To continousely build using babel, run npm run dev.
Thanks. H
1.0.0
7 years ago