argument-parser

0.1.2 • Public • Published

argument-parserBuild Status

var parser = require('argument-parser');
 
function depFileNames() {
    
    // parse out arguments
    var args = parser(arguments);
 
    if (args.hasFormat(['string', 'object', 'array'])) {
 
    } else if (args.hasFormat(['object', 'array'])) {
 
    }
 
 
    args.format(['string', 'object', 'array'], ['name', 'data', 'hobbies'])
        .format(['string', 'array'], ['name', 'hobbies'])
        .format(['object'], ['data'])
        .defaults({
        // name: 'Someone',
            data: {
                age: 'allalalaa'
            },
            hobbies: ['jazz', 'surf']
        })
        .require(['name']);
 
    args = args.evaluate(); // { name, data, hobbies }
 
};
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.2
    9
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.2
    9
  • 0.1.1
    1
  • 0.1.0
    1
  • 0.0.0
    1

Package Sidebar

Install

npm i argument-parser

Weekly Downloads

8

Version

0.1.2

License

none

Last publish

Collaborators

  • simonfan