read-argv
v1.0.0
Published
read the process.argv as an object
Downloads
4
Readme
read-argv
Read the process.argv as an object
The process.argv property returns an array containing the command line arguments passed when the Node.js process was launched. The first element will be process.execPath which will be read by the underscore variable. See process.argv0 if access to the original value of argv[0] is needed. The second element will be the path to the JavaScript file being executed which will also be read by the underscore. The remaining elements will be any additional command line arguments.
Usage:
const readArgv = require('read-argv');
const argv = readArgv(process.argv);
const files = argv._;
const args = argv.$.slice(3);