Process to publish npm package.
Abou Bakar
JavaScript | TypeScript | Full Stack | ReactJs | NextJs | React Native | DRF | GraphQL | Developer at Salla
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
Step2: Create a repository on GitHub.
Step3: Clone your repository from GitHub to your local system.
Step4: cd your-repo-name
Step5: npm init --yes
Step6: Change package.json and add your package name according to your choice.
Step7: Create file or files i.e. index.js and put your logic
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.