npm-library-starter-devendra-demo
v1.0.0
Published
This is a starter template for creating an NPM library.
Readme
My Awesome NPM Library
This is a starter template for creating an NPM library.
How to create your own library
- Write your code: Edit
index.jsto include the functions you want to export. - Update package.json: Change the
"name"field to a unique name for your library (e.g.,my-unique-lib-name). - Login to NPM:
npm login - Publish:
npm publish
Usage
Once published, users can install your library:
npm install my-unique-lib-nameAnd use it in their code:
const myLib = require('my-unique-lib-name');
console.log(myLib.add(2, 3)); // Outputs: 5