Narcissistic, Perfectly Modest
Have opinions about JavaScript? We want to hear them. Take the 2018 JavaScript Ecosystem Survey »

parse-cmd-args

2.0.0 • Public • Published

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

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.

Keywords

install

npm i parse-cmd-args

Downloadsweekly downloads

741

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability