DEV Community

Vivian
Vivian

Posted on

OSD600 - Publishing my-ssg To NPM

1. Lab10 requirement

After a long time updating my-sgg with new features, this time is an appropriate time to provide a release that allows users to install and use the tool easier.

Since the tool is written in NodeJS, I will make use of npm to share the tool.

2. Publishing process

In order to publish a package to npm, I need to create an npm account first. If not, an error code 404 will be appeared.
Image description
Next, I verified the email to authenticate the account. After having an authenticated account, I run npm login command then provided username, password and email to sign in the npm account.

When I logged in successfully, a message will be displayed to announce.
Image description

Finally, I run npm publish command to publish the package to npm.

After making sure that the package is available in npm I asked my friend to test the tool. Instead of telling her how to install and use the package, I recommended her to read through the README.md file first.
With the instruction on README.md she succeeded in installing the package. On her machine, she tested all the provided features and they all worked as expected.

3. Overall

This is an interesting lab, I have a chance to learn new knowledge about npm package since I never published a package before. Also, this is a good way to share my work with others.

All in all, thank you for reading the post.

Happy coding!

Top comments (0)