1.0.0 • Published 6 years ago

read-argv v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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 argv0 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);