npm-package-template
npm-package-template copied to clipboard
:package: minimal NPM package template using Babel, Mocha, Chai, C8, Standardjs, JSDoc and Rollup.
📦 NPM Package Template - Zero Config 📦
Minimal tested and fully functional NPM package template project for ES6+ Javascript.
About this package
This template is intended to allow you to start developing immediatly with a working set of tools and scripts that play well together.
It is little opinionated to the point, that only the most basic tools are integrated. If you want a different flavour you can fork this project and easily replace the tools or add new ones.
What's included?
Tools / stack
- 🗪 Babel for transpiling
- 🪄 Standard for linting
- ⚗️ Mocha and Chai for testing
- 🔍 c8 for code coverage
- 📚 JSDoc for documentation and jsdoc-to-markdown to create docs as markdown files
- ⚡ GitHub actions for continuous integration
- 📦 Rollup for bundling
All tools are defined as dev-dependencies!
Docs and repository
This template repository has all relevant GitHub community standards implemented:
- [x] Description
- [x] README
- [x] Code of conduct
- [x] Contributing
- [x] License
- [x] Security policy
- [x] Issue templates
- [x] Pull request template
Getting started
First, create a new repository with this repository as template or fork the repository and clone it to your local machine.
From here, simply create your Js files in the ./lib folder and add the tests in the test folder.
Use the tools
We provide a default set of tools via npm scripts. Run a script via
$ npm run <command>
where <command> is one of the following available commands:
| command | description | output |
|---|---|---|
lint |
runs the linter in read-mode | |
lint:fix |
runs the linter; fixes minor issues automatically | |
test |
runs the tests once | |
test:watch |
runs the tests; re-runs them on code changes | |
test:coverage |
runs the tests once and creates a coverage report | coverage |
docs |
creates API documentation | docs |
build |
builds the bundles for several target platforms | dist |
build:full |
runs build and docs |
see above |
Contributing and development
We provide an extensive contribution guideline and a code of conduct to help you in making your contribution a success!
Security
Please read our security policy to get to know which versions are covered.
License
MIT, see license file