This package has been deprecated

Author message:

this package has been deprecated

node-argv

0.0.7 • Public • Published

node-argv

Parse argv as a String, then feed minimist and expose the interface:

{
  options: {},
  commands: [],
  through: { // only if '--' is given
    options: {},
    commands: []
  },
  input: [] // parsed argv
}

Parse String

var argv = require('node-argv')
  , options = {}; // minimist options
 
argv('first command --hello true -c "value" -- second command -b', {});
// return
{
  options: {
    hello: true,
    c: 'value'
  },
  commands: ['first', 'command'],
  through: {
    options: {
      b: true
    },
    commands: ['second', 'command']
  },
  input: ['first', 'command', '--hello', 'true', '-c', 'value', '--', 'second', 'command', '-b']
}

Parse Array

This module also parses an Array directly using minimist but exposing the above interface

var argv = require('node-argv');
 
argv(process.argv.slice(2), {});

Target

The third parameter is the optional target, if given it will be used to store the result attributes.

install

With npm do:

npm install node-argv

license

MIT

Readme

Keywords

Package Sidebar

Install

npm i node-argv

Weekly Downloads

53

Version

0.0.7

License

MIT

Last publish

Collaborators

  • gabrieleds