parse-cmd-args
Returns an object containing the path and flags parsed from process.argv
Last updated 4 years ago by neogeek .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install parse-cmd-args 
SYNC missed versions from official npm registry.

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.

Current Tags

  • 2.0.0                                ...           latest (4 years ago)

4 Versions

  • 2.0.0                                ...           4 years ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 10
This Month 0
Last Day 0
Last Week 4
Last Month 25
Dependencies (0)
None
Dev Dependencies (6)

Copyright 2014 - 2016 © taobao.org |