Posts

Showing posts from February, 2021

How to create your own npm packages?

Image
 Two things to keep in mind: 1. Have a package.json file, take a note on the entry point (you can keep it default for now, index.js) 2. Keep track of the version number in package.json file (by default it is 1.0.0, keep it as is for now) Creating a package Follow the below steps to create an npm package  1.        Create a folder:  array-duplicate-reducer 2.        Run : npm init 3.        Leave the defaults as-is for now. In author, you can give details in the below format: kavyashree <bjkavyashree@gmail.com> (javascripthisday.blogspot.com)  your-name <email ID in angle bracket> (website URL in round bracket) ·          This would have created a package.json file by default. ·          You need to add an index.js file which is the first file to be executed when the package loads. · ...