Awesome
NPM Package Example
Just one of the things I'm learning. https://github.com/hchiam/learning
This repo is a fork of https://github.com/ktsn/npm-package-example
To publish your own NPM package:
- Fork this repo or click "Use this template" (in GitHub, see the green button above).
- Edit
package.json
fields (e.g., name, version, author, description, etc.). - Makes sure the
main
field inpackage.json
points to the entry pointindex.js
, or whatever you file/filename you choose. - The
unpkg
field is for browser build. - In CLI: login to NPM with
npm login
command. npm publish
Example published package:
- https://www.npmjs.com/package/hchiam-npm-package-example
- https://unpkg.com/hchiam-npm-package-example
Live example usage (using browser build):
https://codepen.io/hchiam/pen/VwwgZEm
You might also like: