1.1.0 • Published 3 years ago
get-arguments-lib v1.1.0
Get arguments as a dictonary object
Instalation
npm
$ npm install get-arguments-lib --save
yarn
$ yarn add get-arguments-lib -S
Usage
$ 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'