Socket
Book a DemoInstallSign in
Socket

generate-node

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generate-node

Generate a node.js project, with everything you need to begin writing code and easily publish the project to npm.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

generate-node NPM version NPM downloads Build Status

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

git

Runs the default task from generate-git to initialize a git repository. Also git adds and does first commit.

Example

$ gen node:git

mocha

Generate a mocha unit test file.

Example

$ gen node:mocha

npm

Install the latest devDependencies in package.json.

Example

$ gen node:npm

ask

Prompt the user and use answers as context in templates

Example

$ gen node:ask

tasks

Prompt the user to choose which tasks to run.

Example

$ gen node:tasks

files

Prompt the user to choose which files to write to disk.

Example

$ gen node:files

dest

Prompts the user for the dest to use. This is called by the default task.

Example

$ gen node:dest

prompt-mocha

Prompt to generate mocha unit tests. Runs the default task from generate-mocha.

Example

$ gen node:prompt-mocha

prompt-git

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-npm

Prompt to install the latest devDependencies in package.json.

Example

$ gen node:prompt-npm

default

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) {
  // name the sub-generator whatever you want
  app.register('foo', require('generate-node'));
};

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.

Keywords

generate

FAQs

Package last updated on 27 Apr 2016

Did you know?

Socket

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.

Install

Related posts