JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40134
  • Score
    100M100P100Q145538F
  • License MIT

Plugin for base-methods that simplifies mapping argv arguments to tasks, commands, and options

Package Exports

  • base-argv

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (base-argv) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

base-argv NPM version Build Status

Plugin for base-methods that simplifies mapping argv arguments to tasks, commands, and options

Install

Install with npm

$ npm i base-argv --save

Usage

var Base = require('base-methods');
var tasks = require('base-tasks');
var argv = require('base-argv');
var cli = require('base-cli');

var app = new Base();
// register plugins 
app.use(cli());
app.use(tasks());
app.use(argv());

app.task('foo', function() {
  // run gulp plugins or something
});

// parse argv
var args = app.argv(['foo', 'bar', '--set=a:b']);

// if `base-cli` plugin is registered too, this
// will automatically map the resulting object to
// application methods
app.cli.process(args);

Results in:

{ orig: { _: [ 'foo', 'bar' ], set: 'a:b' },
  _: [ 'bar' ],
  tasks: ['foo'],
  commands: { set: { a: 'b' } },
  options: {} }
  • base-cli: Plugin for base-methods that maps built-in methods to CLI args (also supports methods from a… more | homepage
  • base-config: base-methods plugin that adds a config method for mapping declarative configuration values to other 'base'… more | homepage
  • base-methods: Starter for creating a node.js application with a handful of common methods, like set, get,… more | homepage
  • base-options: Adds a few options methods to base-methods, like option, enable and disable. See the readme… more | homepage
  • base-plugins: Upgrade's plugin support in base-methods to allow plugins to be called any time after init. | homepage

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Author

Jon Schlinkert

License

Copyright © 2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb on Tue Dec 01 2015 12:01:27 GMT-0500 (EST).