Skip to content

Latest commit

 

History

History
90 lines (65 loc) · 1.71 KB

.verb.md

File metadata and controls

90 lines (65 loc) · 1.71 KB

Usage

var runner = require('{%= name %}');
var Base = require('base');

runner(Base, options, argv, function(err, app, runnerContext) {
  // `err`: error object, if an error occurred
  // `app`: instance of `base` 
  // `runnerContext`: object with `argv`, `env` and `options` properties
});

Params

  • Base - (required) [base][] constructor
  • options - (required) configuration options
  • argv - (required) parsed process.argv object from [minimist][] or whatever argv parser you prefer.

Example

var runner = require('{%= name %}');
var Base = require('base');
var config = {
  name: 'awesome',
  cwd: process.cwd(),
  runner: require('./package.json'),
  processTitle: 'awesome',
  moduleName: 'awesome',
  extensions: {
    '.js': null
  }
};

runner(Base, options, argv, function(err, app, runnerContext) {
  // `err`: error object, if an error occurred
  // `app`: instance of `base` 
  // `runnerContext`: object with `argv`, `env` and `options` properties
});

API

{%= apidocs("index.js") %}

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) {
});