generate-node

Generate a node.js project, with everything you need to begin writing code and easily publish the project to npm.
Install
Install globally with npm
$ npm install -g generate-node
CLI
Run the node generator from the command line:
$ gen node
Tasks
Runs the default task from generate-git to initialize a git repository. Also git adds and does first commit.
Example
$ gen node:git
Generate a mocha unit test file.
Example
$ gen node:mocha
Install the latest devDependencies in package.json.
Example
$ gen node:npm
Prompt the user and use answers as context in templates
Example
$ gen node:ask
Prompt the user to choose which tasks to run.
Example
$ gen node:tasks
Prompt the user to choose which files to write to disk.
Example
$ gen node:files
Prompts the user for the dest to use. This is called by the default task.
Example
$ gen node:dest
Prompt to generate mocha unit tests. Runs the default task from generate-mocha.
Example
$ gen node:prompt-mocha
Prompt to initialize a git repository (also does git add and first commit). Runs the ask task from generate-git.
Example
$ gen node:prompt-git
Prompt to install the latest devDependencies in package.json.
Example
$ gen node:prompt-npm
Runs the default task to generate complete a node.js project, with all of the necessary files included. Runs the prompt-mocha, prompt-npm, and prompt-git tasks as task-dependencies.
Example
$ gen node
API
To use this generator programmatically, as a plugin or sub-generator, you must first install the generator locally.
Install
Install with npm:
$ npm install generate-node
Usage
Then use in your project:
var node = require('generate-node');
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) {
app.register('foo', require('generate-node'));
};
Related projects
You might also be interested in these projects:
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 docs
Or, if verb is installed globally:
$ verb
Running tests
Install dev dependencies:
$ npm install -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 April 26, 2016.