It was an exciting experience whenever you create something for the first time. For me, it is my first NPM package and also my first Open source contribution. In this article, I will describe how easy to publish NPM Package.
Step 1: npm account
Step 2: Login
We will use Console or Terminal to Login
$ npm adduser or npm login
You’ll get a prompt for your username, password, and email.
Step 3: Let’s make a package
Create a Folder$ mkdir directory_nameCreate a File - Package.json inside the folder$ cd directory_name$ npm init Edit the name in package.json
Note: username: Your NPM username prefix with the '@' symbol
Step 4: Publish Package
npm publish — access=public — first time
npm publish — for update
If everything goes well You will see