DEV Community

Hung Nguyen
Hung Nguyen

Posted on • Updated on

First NPM Package

Overview

npm install osd600-ssg --save
So I am very excited that I have published my first package to NPM. As a Javascript developer, I have used many NPM packages more than I can remember, now, my tool has become a part of them.

Process

I tested my tool locally first to find any possible errors. Then I went to the Internet and did some research and went through some tutorial about how to publish a package to NPM. The steps were not complicated so that all the developers with different levels could publish their tools to the community. However, I had to modify some files.

In package.json, the name of the tool needed to be lowercase, for me, it was not satisfied about that because the original name was all uppercase as that was my favorite naming. I then forgot that I needed to add a git tag to give my tool a version. README.md needed to be updated as well, since my tool now can be run with npm install osd600-ssg, the developers who would like to contribute do not have to clone my git repo anymore. On top of that, I realized that in package.json, I could add a property called repository. This would allow NPM to create a link to your GitHub repo, which is very convenient. Just like GitHub, NPM can read your README.md so it was not difficult for me to fix the instruction and features of my package. And everything is good for other users to test.

Testing

I downloaded my package and tested it. It worked as I expected. I also invited some of my friends to try OSD600-SSG. So far, one of them has had a good review on it, but he recommended me that I needed to specify what packages I used in my tool. Right now, I have still been waiting for the others' feedback.

Usage

npm install osd600-ssg --save
As simply as that. If you have a text or markdown file, and you want to convert it to HTML file, after installing my package, just simply write:
osdssg -i
There are still a lot of options, and you can find them out in the documents in both GitHub and NPM sites. Your feedback will be important for me to improve the tool so that it will get better and better.

Links

GitHub: https://github.com/nguyenhung15913/OSD600-SSG
NPM: https://www.npmjs.com/package/osd600-ssg

Top comments (0)