DEV Community

Cover image for 📦 How to publish your package on npm
Jakub Juszczak
Jakub Juszczak

Posted on

1

📦 How to publish your package on npm

Top comments (3)

Collapse
 
callmemagnus profile image
magnus •

Great summary article. The missing point is about the dependencies version management.

NPM modules suffer from the ~ ^ in the version numbers. Although semver may enforce no changes in the dependencies api, their devs are humans too and may break things.

Therefore, we should enforce module managers to "hardcode" the dependency version. This would also be a step towards reproduceable builds.

Collapse
 
mogery profile image
Gergő Móricz •

yarn init? npm init?

Collapse
 
apertureless profile image
Jakub Juszczak •

Yeah, if you start from scratch, you should npm init :)
ButI assume, you already have a package.json

However, npm init also does not cover all important fields.

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →