Coder Social home page Coder Social logo

generator-node's Introduction

Node Generator Build Status

generator-node creates a base template to start a new Node.js module.

It is also easily composed into your own generators so you can only target your efforts at your generator's specific features.

Maintained by Hemanth.HM.

Install

$ npm install --global generator-node

Usage

$ yo node

Note that this template will generate files in the current directory, so be sure to change to a new directory first if you don't want to overwrite existing files.

That'll generate a project with all the common tools setup. This includes:

Running tests

Once the project is scaffolded, inside the project folder run:

$ npm test

You can also directly use mocha to run test on single files:

$ npm -g install mocha
$ mocha test/name.js

Publishing your code

Once your tests are passing (ideally with a Travis CI green run), you might be ready to publish your code to npm. We recommend you using npm version to tag release correctly.

$ npm version major
$ git push --follow-tags
# ATTENTION: There is no turning back here.
$ npm publish

Extend this generator

First of all, make sure you're comfortable with Yeoman composability feature. Then in your own generator:

module.exports = generators.Base.extend({
  default: function () {
    this.composeWith('node:app', {
      options: {/* provide the options you want */}
    }, {
      local: require.resolve('generator-node/generators/app')
    });
  }
});

Options

Here's a list of our supported options:

  • boilerplate (Boolean, default true) include or not the boilerplate files (lib/index.js, test/index.js).
  • babel (Boolean, default true) include or not a .babelrc file.
  • cli (Boolean, default false) include or not a lib/cli.js file.
  • editorconfig (Boolean, default true) include or not a .editorconfig file.
  • git (Boolean, default true) include or not the git files (.gitattributes, .gitignore).
  • gulp (Boolean, default true) include or not a gulpfile.
  • license (Boolean, default true) include or not a LICENSE file.
  • readme (Boolean, default true) include or not a README.md file.
  • travis (Boolean, default true) include or not a .travis.yml file.

Sub generators

If you don't need all the features provided by the main generator, you can still use a limited set of features by composing with our sub generators directly.

Remember you can see the options of each sub generators by running yo node:sub --help.

  • node:boilerplate
  • node:babel
  • node:cli
  • node:editorconfig
  • node:eslint
  • node:git
  • node:gulp
  • node:license
  • node:readme
  • node:travis

License

MIT © Yeoman team (http://yeoman.io)

generator-node's People

Contributors

addyosmani avatar alexanderzeilmann avatar amitport avatar arthurvr avatar broud avatar corburn avatar danielchatfield avatar foliveira avatar hemanth avatar htynkn avatar hueitan avatar huerlisi avatar iamstarkov avatar jamiebuilds avatar jory avatar jriquelme avatar kevva avatar nfriedly avatar oblongmana avatar passy avatar patnolanireland avatar sboudrias avatar seriema avatar shama avatar sindresorhus avatar sorich87 avatar stefanbuck avatar stevemao avatar thehobbit85 avatar twolfson avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.