Plugin that adds `.taskAlias` method to your @node-base application. Creating alias task for some task.
MIT License
Plugin that adds
.taskAlias
method to your @node-base application. Creating alias task for some task.
npm i base-task-alias --save
For more use-cases see the tests
const baseTaskAlias = require('base-task-alias')
Adds
.taskAlias
method that acceptname
andaliases
. It creates task using the.task
method for each item inaliases
array, which task will point toname
task.
Params
options
{Object}: object to merge with app.options
returns
{Function}: plugin executed by .use
methodExample
var tasks = require('base-task')
var taskAlias = require('base-task-alias')
var Base = require('base')
var app = new Base()
app.use(tasks()).use(taskAlias())
Creates task for each item in
aliases
pointing toname
as dependency.
Params
name
{String}: task name to which each alias will pointopts
{Object|Array}: options passed to .task
or array of aliases
aliases
{Array|String}: list of alias task namesreturns
{Object}: return this
instance for chainingExample
app.use(taskAlias())
app.taskAlias('foo', ['bar', 'qux'])
app.task('foo', function () {
console.log('task: foo')
})
app.build('foo') // => 'task: foo'
app.build('bar') // => 'task: foo'
app.build('qux') // => 'task: foo'
.use
and .run
methods of your Base more | homepage
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. But before doing anything, please read the CONTRIBUTING.md guidelines.