Publishing npm package Part 2: Package Updation
In today’s world front end ecosystem is changing rapidly. Lots of new features, frameworks, libraries are coming out.
We have covered how to create and publish our own npm package in previous blog. In this blog we are going to publish our updated npm package.
Steps to publish npm package changes
1. Install node dependencies
npm install
2. Make changes in source code and commit.
git commit -m 'Added feature to format contact number'
3. Login into npm account
npm login
4. Build Source code to JavaScript code folder.
npm run build
5. Create patch version using following command. It will update local package.json
version and makes local git commit.
npm version patch
6. Publish npm package
using following command. It will publish the npm package
to npm
website.
npm publish
7. Push the code to git repository using following command.
git push
Now our package will be published to npm repository and our code will be pushed to our github repository.