Skip to content

Latest commit

 

History

History
96 lines (60 loc) · 1.81 KB

.verb.md

File metadata and controls

96 lines (60 loc) · 1.81 KB

CLI

Installing the CLI

To run the node generator from the command line, you'll need to install [generate][] globally first. You can that now with the following command:

$ npm i -g generate

This adds the gen command to your system path, allowing it to be run from any directory. Visit the [generate][] project and documentation to learn more.

Run the node generator from the command line

Once both [generate][] and {%= name %} are installed globally, you can run the generator with the following command:

Run the node generator from the command line:

$ gen node

Usage as a sub-generator

You can use generate-node as a [sub-generator][generate]{docs/sub-generators}. See the [generate][] docs for more details.

app.register('foo', require('generate-node'));

This adds the namespace foo to

Usage as a plugin

Extend your generator with the features and settings of this generator.

Example

app.use(require('generate-node'));

// use any task from `generate-node`!
app.task('default', ['files']);

Tasks

{%= apidocs("generator.js") %}

API

To use this generator as a node.js module, as a plugin or sub-generator, you must first install the generator locally.

Install

{%= include("install-npm") %}

Usage

Then use in your project:

var node = require('{%= name %}');

Use as a plugin

In your [generate][] project:

var generate = require('generate');
var app = generate();

app.use(node);

Use as a generator plugin

In your [generate][] generator:

module.exports = function(app) {
  app.use(node);
};

Use as a sub-generator

In your [generate][] generator:

module.exports = function(app) {
  // name the sub-generator whatever you want
  app.register('foo', require('generate-node'));
};