generator-node-ext v0.0.1
Node Generator 
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-nodeUsage
$ yo nodeNote 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.jsonfile - gulp task runner
- Babel ES2015 transpiler
- mocha unit test
- ESLInt linting and code style checking
- Istanbul code coverage (optionally tracked on Coveralls)
- Travis CI continuous integration (optional)
- License
Running tests
Once the project is scaffolded, inside the project folder run:
$ npm testYou can also directly use mocha to run test on single files:
$ npm -g install mocha
$ mocha test/name.jsPublishing 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 publishExtend 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.babelrcfile.cli(Boolean, default false) include or not alib/cli.jsfile.editorconfig(Boolean, default true) include or not a.editorconfigfile.git(Boolean, default true) include or not the git files (.gitattributes,.gitignore).gulp(Boolean, default true) include or not agulpfile.license(Boolean, default true) include or not aLICENSEfile.travis(Boolean, default true) include or not a.travis.ymlfile.readme(String) content of theREADME.mdfile. 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:boilerplatenode:babelnode:clinode:editorconfignode:eslintnode:gitnode:gulpnode:licensenode:readme
License
MIT © Yeoman team (http://yeoman.io)
10 years ago