This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 400,000 packages pre-installed, including
generator-node-bahmutov with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
Creates good package.json for new Node projects
npm install -g yo generator-node-bahmutov
In a new project folder
git init git remote add origin <remote git> yo node-bahmutov
Answer a few questions and you should be all set.
npm run lint
npm run issues
npm run unit
npm run size
npm run ban
npm run license
npm run depsand
npm run unused-deps
npm run output for the full list of scripts.
It is hard to remember
yo node-bahmutov command, so I suggest using an
alias to start a good NPM module. Run this command or place it in your
# create new NPM module using Yeoman generator-node-bahmutov alias new_module='yo node-bahmutov && yo node-bahmutov:release'
Make a folder, init new Git repo, set remote GitHub origin url and then call the alias
Answer 3 questions and you will be all set!
I recommend installing semantic release right away after bootstrapping the project, it will work nicely with the commit message format. We already include the semantic release badge in the generated README file, so you have no excuse
npm i -g semantic-release-cli semantic-release-cli setup
Add version back into
package.json, I recommend
If you use GitLab, you should take a look at semantic-release-gitlab
You can generate a Dockerfile with good defaults for running the current Node project inside a docker container. Based on Docker file in this gist.
This generator also adds
docker-* commands to the
package.json to build
the image, run and stop the container.
You can see the full Dockerfile template.
Assumes you have global
semantic-release-cli tool already preset, if not
npm install --global semantic-release-cli
Change into an empty folder, for example
cd /tmp mkdir test-generator cd test-generator yo node-bahmutov
Or just run
npm run e2e (assumes global
yo install). The go into the
/tmp/test-node-generator and run the project. You can even
build the Docker image and try running the project inside the container.
Run the generator with environment variable DEBUG set to "gen"
DEBUG=gen yo node-bahmutov
This generator assumes there is already a remote Git (probably GitHub or GitLab) repository where all code will live. Please create it first and then set it before running generator
git init git remote add origin <remote git>
Author: Gleb Bahmutov © 2016
License: MIT - do anything with the code, but don't blame me if it does not work.
Spread the word: tweet, star on github, etc.
Support: if you find any problems with this module, email / tweet / open issue on Github
Copyright (c) 2016 Gleb Bahmutov
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.