2.8.0 • Published 4 years ago

generator-node v2.8.0

Weekly downloads
1,006
License
MIT
Repository
github
Last release
4 years ago

Node Generator Build Status Gitter OpenCollective

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.

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:

  • Filled package.json file
  • jest unit test and code coverage (optionally tracked on Coveralls)
  • ESLint linting and code style checking
  • Travis CI continuous integration (optional)
  • License

Running tests

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

$ npm test

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

$ npm -g install jest-cli
$ jest --watch

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:

var Generator = require('yeoman-generator');

module.exports = class extends Generator({
  default() {
    this.composeWith(require.resolve('generator-node/generators/app'), {
      /* provide the options you want */
    });
  }
});

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).
  • 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).
  • license (Boolean, default true) include or not a LICENSE file.
  • travis (Boolean, default true) include or not a .travis.yml file.
  • githubAccount (String) Account name for GitHub repo location.
  • readme (String) content of the README.md file. Given this option, generator-node will still generate the title (with badges) and the license section.

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:cli
  • node:editorconfig
  • node:eslint
  • node:git
  • node:readme

Backers

Love Yeoman work and community? Help us keep it alive by donating funds to cover project expenses! [Become a backer]

License

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

generator-elasticiogenerator-mg-yanzigenerator-mongolia@everything-registry/sub-chunk-1740@seedrs/generator-seedrs-reactvosp-cli@springcomp/generator-ts@xieyanmeizi/mg-clisindresorhus.jsgenerator-leaflet-plugin-with-rollupgenerator-leitstandgenerator-ps-iowgenerator-ps-search-ui-sfdcgenerator-preact-app-startergenerator-react-plusgenerator-react-library-startergenerator-rmgenerator-swordsmangenerator-swproxy-modgenerator-gfe-h-vuegenerator-gfe-legogenerator-gfe-peon-staticgenerator-future-staticgenerator-neptungenerator-nest-microservicegenerator-node-bandwidthgenerator-iscincgenerator-landingpagesgenerator-moontestgenerator-mvwcreatorgenerator-ribarich-wordpressgenerator-module-toolgenerator-mlewand-nodegenerator-ts-microservicegenerator-z-cligenerator-zakodiumgenerator-virgogenerator-xxxgenerator-uservicegenerator-webvrgenerator-webpack-library-startergenerator-webpack-mpagenerator-co-microservicegenerator-coffee-nodegenerator-coffeegengenerator-codezero-provisionergenerator-cyclone-cligenerator-danger-plugingenerator-angular-2-crudgenerator-angular-brogenerator-angular-coffee-sassgenerator-angular2-webpack-full-configgenerator-angular-typescript-sassgenerator-apu-codeignitergenerator-atom-package-plusgenerator-aslgenerator-backedgenerator-backed-elementgenerator-boneskullgenerator-billundgenerator-build-offergenerator-buildbot-dashboardgenerator-express-boilerplategenerator-express-custom-boilerplategenerator-esnext-projectgenerator-digital360-silverstripegenerator-discordbotgenerator-easilygenerator-dx-generatorgenerator-edu-generatorgenerator-ecmascript-proposalgenerator-edgegenerator-frans-reactgenerator-javascriptgenerator-logoran-nodegenerator-hapi-microgenerator-hapi-middlemangenerator-npm-module-typescriptgenerator-oda-api-simplegenerator-ortoo-event-functiongenerator-generatorgenerator-generator-androidgenerator-h-vue-componentgenerator-hy-meangenerator-node-react-fullstackgenerator-nodecggenerator-peon-staticgenerator-paypal-integrationsgenerator-react-scaffoldgenerator-s-webappgenerator-simple-jsgenerator-speedcontrolgenerator-sma-plugin-mavgenerator-smack-buildgenerator-sma-plugingenerator-starteran2generator-wp-trinity
2.8.0

4 years ago

2.7.0

5 years ago

2.6.0

5 years ago

2.5.0

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

7 years ago

2.2.0

7 years ago

2.1.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.12.1

8 years ago

1.12.0

8 years ago

1.11.0

8 years ago

1.10.2

8 years ago

1.10.1

8 years ago

1.10.0

8 years ago

1.8.3

8 years ago

1.8.2

8 years ago

1.8.1

8 years ago

1.8.0

8 years ago

1.7.1

8 years ago

1.7.0

8 years ago

1.6.1

8 years ago

1.6.0

9 years ago

1.5.2

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.0

9 years ago

0.7.0

9 years ago

0.6.0

9 years ago

0.5.0

9 years ago

0.4.4

9 years ago

0.4.3

10 years ago

0.4.2

10 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.1

10 years ago

0.3.0

10 years ago

0.2.0

10 years ago

0.1.0

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago