A node module boilerplate
npm install @maximdevoir/node-module-boilerplate> A modern boilerplate for developing and building Node modules.


Begin by cloning the repository
``bash
git clone https://github.com/MaximDevoir/node-module-boilerplate.git my-module
cd my-module
yarn install
`
You can now yarn run start and being editing the source at src/index.js.
Tests can be added to the tests directory. Tests execute by yarn run test*.spec.js
when they follow the naming format .
- Webpack V4
- Babel setup to ES9, exporting to UMD.
- ESLint for linting
- Mocha and Chai for testing
- NYC and Istanbul for code coverage, with Coveralls for online coverage
- GitHub Actions for branch pushes and conditional publish to NPM, with separate
Action for Pull Requests. See .github/main.workflow for instructions on.github/stale.yml
setting up.
- Probot Stale, see for installation instruction.
#### GitHub Actions
The workflow file is located at .github/main.workflow. To begin using actions,
you must add the following secrets to your GitHub's repository:
* SNYK_TOKEN for integration with Snyk's dependency vulnerability detectionNPM_AUTH_TOKEN
service. Go to your Snyk Account Settings to
retrieve your API token.
* for automatic public publishing to NPM. Visitread and publish
https://www.npmjs.com/settings/USERNAME/tokens to generate a new token with
access level.COVERALLS_REPO_TOKEN
* for code coverage from Coveralls. Get the repo token,
after syncing Coveralls with your repository, from
https://coveralls.io/repos
#### Probot Stale
Configuration for probot-stale - https://github.com/probot/stale
Running yarn run build will build the module in production mode. Your module
is now ready to be published.
yarn run coverage generates a coverage report. You can view the output in thecoverage/ directory.
yarn run lint will lint all applicable files in your project. You can runyarn run lint:fix to fix issues that can be fixed automatically.
yarn start or yarn run start will build the application in development modesrc/
and watch for changes in your directory. Run yarn run start:once to
build once and exit.
yarn run test will execute your tests in tests/*.spec.js once. You may alsoyarn run test:watch` to continue running tests as changes are detected.
use