Skip to content
πŸ” Returns an object containing the path and flags parsed from process.argv
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.bithoundrc
.eslintignore
.eslintrc
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
DOCUMENTATION.md
LICENSE
README.md
index.js
package.json

README.md

parse-cmd-args

Returns an object containing the path and flags parsed from process.argv

Build Status codecov devDependencies Status Known Vulnerabilities bitHound Overall Score NPM Version Greenkeeper badge Latest Documentation

Install

$ npm install parse-cmd-args --save

Usage

const args = require('parse-cmd-args')();

if (args.flags['--version'] || args.flags['-v']) {

    process.stdout.write(`${require('../package').version}\n`);
    process.exit();

} else if (args.flags['--help'] || args.flags['-h']) {

    process.stdout.write('Usage: \n');
    process.exit();

}

const output = args.flags['--output'] || args.flags['-o'] || null;

console.log(output);

Documentation

View full documentation here.

You can’t perform that action at this time.