Process to publish npm package.

Process to publish npm package.

npm is a package manager for the JavaScript programming language. npm, Inc. is a subsidiary of GitHub, that provides hosting for software development and version control with the usage of Git.

This is very easy to publish your own package to npm.


Step1: Open your terminal and run npm login or npm addUser

No alt text provided for this image
No alt text provided for this image

Step2: Create a repository on GitHub.

No alt text provided for this image
No alt text provided for this image

Step3: Clone your repository from GitHub to your local system.

No alt text provided for this image
No alt text provided for this image


Step4: cd your-repo-name

Step5: npm init --yes

No alt text provided for this image


Step6: Change package.json and add your package name according to your choice.

No alt text provided for this image


Step7: Create file or files i.e. index.js and put your logic

No alt text provided for this image
No alt text provided for this image


Step7: Run npm publish


Congratulations!!! You publish your first npm package successfuly.

Thank you so much for reading this article. Support and share with your friends.

要查看或添加评论,请登录

社区洞察

其他会员也浏览了