get-arguments-lib
v1.1.0
Published
Gets argument as switches with double dash, and return a dictionary object
Readme
Get arguments as a dictonary object
Instalation
npm
$ npm install get-arguments-lib --saveyarn
$ yarn add get-arguments-lib -SUsage
$ node <your js file> --port 3004 --host myHost
const processArguments = getArguments(process.argv);
const port = processArguments.port ? +processArguments.port : 3000;
const host = processArguments.host;
// port value is 3004
// host value is 'myHost'
