LEARNNode CLI Automation

Publish a Node Module – Part #6

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!

Publishing cli-alerts Node Module

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 repo
git add .
#staging all files
git commit -m "first version"
#pushing to GitHub
git 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

Wrapping Up

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.

Posted by Saad (It's a work in progress: Needs copy editing review by Awais.)