Package Exports
- generate
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 (generate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
generate

Fast, composable, highly extendable project generator with a user-friendly and expressive API.
You might also be interested in verb.
TOC
- Install
- Usage
- What is generate?
- Quickstart
- Related projects
- Contributing
- Building docs
- Running tests
- Author
- License
(TOC generated by verb using markdown-toc)
Install
Install globally with npm
$ npm install -g generateUsage
var Generate = require('generate');
var base = new Generate();
base.register('one', function(app) {
app.task('default', function(cb) {
console.log('task > default');
cb();
});
});
base.register('two', function(app) {
app.task('default', function(cb) {
console.log('task > default');
cb();
});
app.task('foo', function(cb) {
console.log('task > foo');
cb();
});
app.task('bar', function(cb) {
console.log('task > bar');
cb();
});
});
// run the `default` task on generator `one`
base.generate('one', function(err) {
if (err) throw err;
});
// run the `bar` task on generator `two`
base.generate('two', 'bar', function(err) {
if (err) throw err;
});What is generate?
Generate is a fast, highly pluggable project generator, with a user-friendly CLI and an expressive API.
Feature Highlights
- Built on assemble-core, so all methods from base, assemble, and templates are exposed on generate's API.
- Supports gulp and assemble plugins
- Runs local or globally-installed generators
- Runs sub-generators using simple dot-notation. Supports any level of nesting!
- Runs gulp-style "tasks" and uses some of the same underlying libraries as gulp
- Generators can extend and use other generators
- Generators, sub-generators and tasks can be run by command line, API, or both.
- Runs tasks from any generator or sub-generator, programmatically or via CLI
- Easy to add functionality and features to generate using via plugins
- Supports any node.js template engine, including consolidate
- First class support for template collections, including pagination, sorting, groups, and more.
- Supports middleware that can be run on specific files or template collections, at specific points during the build cycle, such as
onLoad,preRender,postRender, etc.
Generate is also well-tested, with close to 1200 unit tests.
Quickstart
1. generator.js
Create a generator.js file, and add the following code:
module.exports = function(app) {
app.task('default', function(cb) {
console.log('task > default');
cb();
});
app.task('foo', function(cb) {
console.log('task > foo');
cb();
});
};2. Run gen
In the command line run:
gento execute thedefaulttaskgen footo execute thefootask
Related projects
You might also be interested in these projects:
- assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
- base: base is the foundation for creating modular, unit testable and highly pluggable node.js applications, starting… more | homepage
- update: Easily keep anything in your project up-to-date by installing the updaters you want to use… more | homepage
- verb: Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… 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 April 23, 2016.