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

Orchestrate multiple instances of base-methods at once.
Install
Install with npm:
$ npm install base-runner --saveUsage
var runner = require('base-runner');
var Base = require('base');
runner(Base, config, argv, function(err, app, runnerContext) {
// `err`: error object
// `app`: instance of `base`
// `runnerContext`: object with `argv`, `env` and `config` properties
});API
runner
Create a runner with the given constructor, liftoff config object, argv object and callback function.
Params
Ctor{Function}: Constructor to use, must inherit base.config{Object}: The config object to pass to liftoff.argv{Object}: Argv object, optionally pre-parsed.cb{Function}: Callback function, which exposeserr,app(base application instance) andrunnerContextreturns{Object}
Example
var Base = require('base');
var argv = require('minimist')(process.argv.slice(2));
var config = {
name: 'foo',
cwd: process.cwd(),
extensions: {'.js': null}
};
runner(Base, config, argv, function(err, app, runnerContext) {
if (err) throw err;
// do stuff with `app` and `runnerContext`
process.exit();
});Events
The following constructor events are emitted:
preInit
Exposes runnerContext as the only paramter.
Base.on('preInit', function(runnerContext) {
});init
Exposes runnerContext and app (the application instance) as paramters.
Base.on('init', function(runnerContext, app) {
});postInit
Exposes runnerContext and app (the application instance) as paramters.
Base.on('postInit', function(runnerContext, app) {
});finished
Exposes runnerContext and app (the application instance) as paramters.
Base.on('finished', function(runnerContext, app) {
});Related projects
You might also be interested in these projects:
- base-generators: Adds project-generator support to your
baseapplication. | homepage - base-options: Adds a few options methods to base-methods, like
option,enableanddisable. See the readme… more | homepage - base-plugins: Upgrade's plugin support in base applications to allow plugins to be called any time after… more | homepage
- base-store: Plugin for getting and persisting config values with your base-methods application. Adds a 'store' object… more | homepage
- base-tasks: base-methods plugin that provides a very thin wrapper around https://github.com/jonschlinkert/composer for adding task methods to… more | homepage
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Building docs
Generate readme and API documentation with verb:
$ npm install verb && npm run docsOr, if verb is installed globally:
$ verbRunning tests
Install dev dependencies:
$ npm install -d && npm testAuthor
Jon Schlinkert
License
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on April 20, 2016.