0.0.0 • Published 8 years ago
base-task-render v0.0.0
base-task-render
Install
npm i base-task-render --save
Usage
For more use-cases see the tests
const baseTaskRender = require('base-task-render')
baseTaskAlias
Adds
.taskRender
method to your app which makes it easier to create and run tasks which need rendering. It uses base-fs-conflicts to detect file conflicts.
Params
options
{Object}: object to merge withapp.options
returns
{Function}: plugin executed by.use
method
Example
// Plugins
var fs = require('base-fs')
var tasks = require('base-task')
var render = require('assemble-render-file')
var conflicts = require('base-fs-conflicts')
var taskAlias = require('base-task-alias')
var taskRender = require('base-task-render')
// Create app
var Base = require('base')
var app = new Base()
// Load plugins
app.use(tasks())
app.use(render())
app.use(taskRender())
app.use(conflicts())
app.use(fs())
// Tasks
app.taskAlias('foo', ['bar', 'qux'])
app.taskRender('foo', '*.md')
// `.taskAlias` created `bar` and `qux` aliases
// of the `foo` task
app.build('qux', function (err) {
if (err) return console.error(err)
// => render all markdown files from `templates/` dir
// or pass `app.options.srcBase` if you want to change it
})
.taskRender
Creates a task with
name
to render glob ofpatterns
fromtemplates/
directory (default), or fromapp.options.srcBase
using*
engine. It also checks for file conflicts using base-fs-conflicts.
Params
name
{String}: task nameopts
{Object|Array}: options passed to.task
or array ofdeps
deps
{Array|String}: list of dependency taskspatterns
{Array|String}: list of patterns to pass to.src
methodreturns
{Object}: returnthis
instance for chaining
Example
app.use(taskRender())
app.taskRender('foo', ['CONTRIBUTING.md', '*.md'])
app.build('foo', console.log)
// => will render all markdown files
// from `templates/` directory (default)
Related
- base-plugins-enhanced: Error handling and extras for
.use
and.run
methods of your Base… more | homepage - base-plugins: Upgrade's plugin support in base applications to allow plugins to be called… more | homepage
- base-task-alias: Plugin that adds
.taskAlias
method to your @node-base application. Creating alias task… more | homepage - base-task: base plugin that provides a very thin wrapper around https://github.com/doowb/composer for adding… more | homepage
- base: base is the foundation for creating modular, unit testable and highly pluggable… more | homepage
- generate: Command line tool and developer framework for scaffolding out new GitHub projects… more | homepage
- verb-generate-readme: Generate your project's readme with verb. Requires verb v0.9.0 or higher. | homepage
- verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use… more | homepage
Contributing
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.
Charlike Make Reagent
0.0.0
8 years ago