
Product
Introducing Supply Chain Attack Campaigns Tracking in the Socket Dashboard
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.
generate-target
Advanced tools
Plugin for automatically creating tasks from declarative `target` configurations. Works with generate, assemble, verb, or any other base application with plugin support.
Plugin for automatically creating tasks from declarative target configurations. Works with generate, assemble, verb, or any other base application with plugin support.
Can be used with any base application, including assemble, generate, and update.
var target = require('generate-target');
var Base = require('base');
var targets = require('base-target');
var app = new Base({isApp: true});
app.use(targets());
// create a target
app.target('abc', {
src: 'templates/*.hbs',
dest: 'site',
});
// get a target
app.target('abc')
.generate({cwd: 'fo'}) // build the files in a target
.on('error', console.error)
.on('end', function() {
console.log('done!');
});
See the expand-target library for additional information and API documentation.
Asynchronously generate files from a declarative target configuration.
Params
target {Object}: Target configuration object.next {Function}: Optional callback function. If not passed, .targetStream will be called and a stream will be returned.Example
var Target = require('target');
var target = new Target({
options: {cwd: 'source'},
src: ['content/*.md']
});
app.targetSeries(target, function(err) {
if (err) console.log(err);
});
Generate files from a declarative target configuration.
Params
target {Object}: target configuration object.returns {Stream}: returns a stream with all processed files.Example
var Target = require('target');
var target = new Target({
options: {},
files: {
src: ['*'],
dest: 'foo'
}
});
app.targetStream(target)
.on('error', console.error)
.on('end', function() {
console.log('done!');
});
If the instance has a task method, a task is automatically created for each target.
Example
app.target('docs', {src: 'src/docs/*.md', dest: 'docs'});
app.target('site', {src: 'src/site/*.hbs', dest: 'site'});
app.build(['docs', 'site'], function(err) {
if (err) return console.log(err);
console.log('done!');
});
Disable auto-tasks
Pass options to the plugin to disable this feature.
app.use(targets({tasks: false}));
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Install dev dependencies:
$ npm install -d && npm test
Jon Schlinkert
Copyright © 2016, Jon Schlinkert. Released under the MIT license.
This file was generated by verb, v0.9.0, on July 19, 2016.
FAQs
Plugin for automatically creating tasks from declarative `target` configurations. Works with generate, assemble, verb, or any other base application with plugin support.
We found that generate-target demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Campaign-level threat intelligence in Socket now shows when active supply chain attacks affect your repositories and packages.

Research
Malicious PyPI package sympy-dev targets SymPy users, a Python symbolic math library with 85 million monthly downloads.

Security News
Node.js 25.4.0 makes require(esm) stable, formalizing CommonJS and ESM compatibility across supported Node versions.