DEV Community

Vivian
Vivian

Posted on

1

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!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more