read-argv

1.0.0 • Public • Published

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

/read-argv/

    Package Sidebar

    Install

    npm i read-argv

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    3.64 kB

    Total Files

    4

    Last publish

    Collaborators

    • adriancmiranda