I recently added my node.js console application RefactorCode to NPM to make it easier for users to install the application without cloning the repo. It was surprisingly simple and I have laid out the steps below:
You need to first create an npmjs account from here: https://www.npmjs.com/
Once that's done, go to the root directory of the project, and type:
npm login
This will take you to the login page and after being successfully authenticated, type npm publish
to push the project to NPM:
And that's it!
Here is my package if you are curious:
https://www.npmjs.com/package/refactorcode
Other stuff
I made a release for the application by tagging a release:
git tag -a v1.0.1
And the pushing it to github:
git push --follow-tags
I also tested if others were able to access the application by asking my brother to try installing it, he was able to set it up from NPM pretty easily after looking at the README file.
Although, it is a bit harder compared to normal packages since you have to specify environment variables for the API key, but the screenshots helped.
Top comments (0)