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

Add the docs, includes, badges, and layouts collections, along with a few generic defaults to your generator.
You might also be interested in generate-defaults.
Install
Install with npm:
$ npm i generate-collections --save
Quickstart
Getting started
If you're not already familiar with generate, you might find generate's getting started guide useful before continuining.
Usage
With both generate-collections
and generate
installed globally, you should now be able to run this generator's default task with the following command:
$ gen collections
If the generator and its task completed successfuly, you should see something like this in the terminal:
[00:44:21] starting collections generator
[00:44:21] starting collections:default task
[00:44:22] finished collections:default task 63ms
[00:44:22] finished collections generator 68ms
[00:44:22] finished ✔
Extend your generator
The usage instructions explain how to use this as a standalone generator, but you can also use generate-collections
to extend your own generator, and cut down on boilerplate code needed to get up and running.
To extend your generator, add the .extendWith()
line inside your generator:
var collections = require('generate-collections');
module.exports = function(app) {
collections.invoke(app[, options]);
// do generator stuff
};
That's it! you should now be able to use any features from generate-collections
as if they were created in your own generator.
Override settings
You can override any feature or setting from generate-collections
by defining new values. E.g. we aren't doing any magic, the .invoke
method just calls this generator in the context of your generator's instance.
Advanced usage
Lazily-extend your generator
Run the collections
task to lazily add the features and settings from generate-collections
.
This approach offers the advantage of choosing when and where to invoke generate-collections
inside your own generator.
module.exports = function(app) {
app.extendWith(require('generate-collections'));
app.task('foo', function(cb) {
// do task stuff
cb();
});
app.task('default', ['collections', 'foo']);
};
Note that before running task foo
, you MUST RUN the collections
task to get the features from generate-collections
loaded onto your generator's instance.
API
Compatibility
This generator works with:
Related projects
- assemble: Assemble is a powerful, extendable and easy to use static site generator for node.js. Used… more | homepage
- generate: Fast, composable, highly extendable project generator with a user-friendly and expressive API. | 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 i -d && npm run docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm i -d && npm test
Author
Jon Schlinkert
License
Copyright © 2016 Jon Schlinkert Released under the MIT license.
This file was generated by verb, v0.9.0, on February 21, 2016.