NPM Package Example
July 19, 2020 ยท View on GitHub
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.jsonfields (e.g., name, version, author, description, etc.). - Makes sure the
mainfield inpackage.jsonpoints to the entry pointindex.js, or whatever you file/filename you choose. - The
unpkgfield is for browser build. - In CLI: login to NPM with
npm logincommand. 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: