https://github.com/albert-gao/modern-es6-npm-boilerplate
An ES6 boilerplate for writing NPM package.
https://github.com/albert-gao/modern-es6-npm-boilerplate
babel boilerplate es6 eslint javascript jest npm template
Last synced: about 1 month ago
JSON representation
An ES6 boilerplate for writing NPM package.
- Host: GitHub
- URL: https://github.com/albert-gao/modern-es6-npm-boilerplate
- Owner: Albert-Gao
- License: mit
- Created: 2017-10-15T07:32:35.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-09T21:38:11.000Z (about 7 years ago)
- Last Synced: 2025-03-28T14:11:07.398Z (about 2 months ago)
- Topics: babel, boilerplate, es6, eslint, javascript, jest, npm, template
- Language: JavaScript
- Homepage:
- Size: 304 KB
- Stars: 44
- Watchers: 3
- Forks: 4
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Modern ES6 NPM Boilerplate
[](https://badge.fury.io/js/veasy)
[](https://www.npmjs.com/package/veasy)
[](https://travis-ci.org/Albert-Gao/modern-es6-npm-boilerplate)A template which you could use to write your NPM package via ES6 syntax.
It uses:
- Babel
- Jest
- ESLint (with Airbnb and prettier)Just added 1 more:
- "babel-plugin-transform-object-rest-spread",
## How to use
1. Clone this repo from github
- `git clone https://github.com/Albert-Gao/es6-npm-boilerplate.git`
1. Inside repo directory run `npm install && rm -r .git && git init`
1. Update package.json with your information## Commands
- `npm run check` : Checking the updates of all your dependencies
- `npm run lint` : linting via ESLint
- `npm run clean` : Clean the `./dist` folder
- `npm run build`: Clean and build `src` to `dist`
- `npm run test`: Run tests via `Jest`
- `npm run test -- --coverage`: Generates test coverage report via `Jest`
- `npm run example`: Run example to see if the transpiled code works or not.
- `npm run prepublish`: Clean, lint, test then build,
- `npm run pub`: Interactive way to checking, clean, test, bumping version, tag commits, push repo and publish## Badges
We currently have 3 badges here:
- Version: Generate your own at [https://badge.fury.io/](https://badge.fury.io/)
- Licence: Generate your own at [http://shields.io/](http://shields.io/)
- Building status: If you travis, open your project there, there should be badge at the top part, click it to get your own.## About travis
Instead of running the default `test` command, we will run the `npm run prepare` since it including all the phases for the final release.
And in the readme.md, we have a status icon which shows how to add that building status from Travis. Do remember to modify its URL after forking your repo.
## About .vscode folder
It contains an example to show how to debug the `Jest` test in Visual studio code, remove it if you don't want.
You should add `.vscode` to the `.gitignore` file.