This is a six articles series for building and publishing a node module from scratch. You can find all these articles below:
I have successfully implemented everything I needed in my node module. Now it is time to publish it. So without any further ado, let's jump right in!
The first thing I am going to do is commit my node module to GitHub. For that, I am going to run the following commands one by one.
#adding everything to local git repogit add .#staging all filesgit commit -m "first version"#pushing to GitHubgit push
Now the next thing I need to do is launch a version of cli-alerts
. I have to launch a major version. For this, I am going to run the following command inside my project terminal.
npm version major -m "🚀 RELEASE: 1.0.0"
I am going to create a readme.md
file and write all the required documentation. And finally, I am going to run the following command in the terminal to publish this module on npmjs:
npm publish
In these past five articles, I showed you how easy it is to write a node module. And in this piece, I published it so anyone can use it. Now go ahead and write some useful node modules so other developers like me can also use them in their projects.