npm-pkg-gen
- Scaffolds an npm package with a single command
Installation
Install npm-pkg-gen with npm
npm install -g npm-pkg-gen
Or with Yarn, if you prefer that:
yarn global add npm-pkg-gen
Usage
To scaffold a package:
npg <package-name>
NOTE: You must make sure that the package name you've provided is available on the npm registry. If the package name you've provided is taken, you won't immediately get an error, but your CI job will fail later.
Once the package has been scaffolded, you need add a Github remote repo. Then, you need to create two Github repo secrets to complete the configuration:
-
GH_TOKEN
– This is supposed to contain a Github Personal Access Token. Here's how you can make one. Make sure to make it permissive enough (might as well check all the boxes if you are unsure). -
NPM_TOKEN
– This one is supposed to contain an npm automation token. Check out this guide to know how to make one.
NOTE: Whenever you make a commit, you must use git cz
instead of git commit
.