0.0.0 • Published 9 years ago
base-task-render v0.0.0
base-task-render

Install
npm i base-task-render --saveUsage
For more use-cases see the tests
const baseTaskRender = require('base-task-render')baseTaskAlias
Adds
.taskRendermethod 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.optionsreturns{Function}: plugin executed by.usemethod
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
nameto render glob ofpatternsfromtemplates/directory (default), or fromapp.options.srcBaseusing*engine. It also checks for file conflicts using base-fs-conflicts.
Params
name{String}: task nameopts{Object|Array}: options passed to.taskor array ofdepsdeps{Array|String}: list of dependency taskspatterns{Array|String}: list of patterns to pass to.srcmethodreturns{Object}: returnthisinstance 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
.useand.runmethods 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
.taskAliasmethod 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
9 years ago