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');
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.jsetc.callback{Function}: Callback that exposeserr,argvandappas arguments.argvis pre-processed by minimist then processed by expand-args. The originalargvarray is exposed onargv.orig, and the object returned by minimist is exposed onargv.minimist.appis 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
});
});.cwd
Set the current working directory.
Example
{
"name": "my-project",
"verb": {
"cwd": "foo/bar"
}
}.data
Merge data onto the app.cache.data object. If the base-data plugin is registered, this is the API-equivalent of calling app.data().
Example
{
"name": "my-project",
"verb": {
"data": {
"foo": "bar"
}
}
}.engines
Alias for engines
.engines
(Requires templates, otherwise ignored)
Register engines to use for rendering templates. Object-keys are used
for the engine name, and the value can either be the module name, or
an options object with the module name defined on the name property.
(Modules must be locally installed and listed in dependencies or
devDependencies).
Example
// module name
{"verb": {"engines": {"*": "engine-base"}}}
// options
{"verb": {"engines": {"*": {"name": "engine-base"}}}}.helpers
(Requires templates, otherwise ignored)
Register helpers to use in templates. Value can be a string or
array of module names, glob patterns, or file paths, or an object
where each key is a filepath, glob or module name, and the value
is an options object to pass to resolved helpers.
(Modules must be locally installed and listed in dependencies or
devDependencies).
Example
// module names
{
"verb": {
"helpers": {
"helper-foo": {},
"helper-bar": {}
}
}
}
// register a glob of helpers
{
"verb": {
"helpers": ["foo/*.js"]
}
}.options
Merge options onto the app.options object. If the base-option plugin is registered, this is the API-equivalent of calling app.option().
Example
{"verb": {"options": {"foo": "bar"}}}.plugins
Load pipeline plugins. Requires the base-pipeline plugin to be registered.
(Modules must be locally installed and listed in dependencies or
devDependencies).
Example
{"verb": {"plugins": {"eslint": {"name": "gulp-eslint"}}}}.toc
Enable or disable Table of Contents rendering, or pass options on the verb config object in package.json.
Example
{
"name": "my-project",
"verb": {
"toc": true
}
}.use
Define plugins to load. Value can be a string or array of module names.
(Modules must be locally installed and listed in dependencies or
devDependencies).
Example
{"verb": {"use": ["base-option", "base-data"]}}Related projects
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage
- 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
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 March 03, 2016.