JSPM

  • Created
  • Published
  • Downloads 24888
  • Score
    100M100P100Q132908F
  • License MIT

Orchestrate multiple instances of base-methods at once.

Package Exports

  • base-runner

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-runner) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

base-runner NPM version Build Status

Orchestrate multiple instances of base-methods at once.

Install

Install with npm:

$ npm i base-runner --save

Usage

var runner = require('base-runner');
var Base = require('base');
var base = new Base();

Register the plugin

base.use(runner());

With the plugin registered, you can now call the .runner method with the name of the "configfile" to search for (e.g. verbfile.js, generator.js, assemblefile.js, etc):

base.runner('configfile.js', function(err, argv, app) {
  // `err`: error object
  // `argv`: command line arguments, parsed by minimist and pre-processed
  // `app`: instance of `base` with configfile.js invoked
});

Example usage

base.runner('generator.js', function(err, argv, app) {
  if (err) throw err;

  app.cli.process(argv, function(err) {
    if (err) throw err;

  });
});

API

Params

  • configfile {String}: The name of the configfile to initialize with. For example, generator.js, assemblefile.js, verbfile.js etc.
  • callback {Function}: Callback that exposes err, argv and app as arguments. argv is pre-processed by minimist then processed by [expand-args][]. The original argv array is exposed on argv.orig, and the object returned by minimist is exposed on argv.minimist. app is the resolved application instance to be used.
  • returns {undefined}

Example

base.runner('verbfile.js', function(err, argv, app) {
  // handle err
  // do stuff with argv and app

  app.cli.process(argv, function(err) {
    // handle err
  });
});

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 © 2016 Jon Schlinkert Released under the MIT license.


This file was generated by verb, v0.9.0, on February 09, 2016.