@pratik.galoria/minimal-js-library
v1.0.2
Published
Minimal JavaScript library boilerplate
Downloads
3
Maintainers
Readme
@pratik.galoria/minimal-js-library
Minimal JavaScript library boilerplate for your next project.
Kick start your own JavaScript library and publish as a npm
package.
Features
- ES6 - Babel will transpile the code
- Test - Jest with coverage
- Lint - Eslint with recommended config
- CI - Travis-ci minimal config
- Minify - Builds the minified code
Quick Start
- Clone the repository:
git clone https://github.com/pratikgaloria/minimal-js-library.git
- Edit the source inside
src
folder. - Build the project and test.
npm run build
npm test
Publish
npm login
#Logged in as pratik.galoria to scope @pratik.galoria on https://registry.npmjs.org/.
npm publish
# + @pratik.galoria/[email protected]
Step by step guide to publish the package: https://www.freecodecamp.org/news/how-to-make-a-beautiful-tiny-npm-package-and-publish-it-2881d4307f78/
Usage
Once published as a npm package, you can install the library on any of your project using npm:
npm install --save @pratik.galoria/minimal-js-library
And then, use like this:
import sum from '@pratik.galoria/minimal-js-library';
console.log(sum(1, 2)); // 3
Commands
npm run build
- Babel will transpile ES6 to ES5 and minify the code.npm run lint
- Run Eslint with recommended confignpm test
- Run Jest with coverage results
License
MIT © Pratik Galoria