When to use package-lock.json and shrinkwrap.json

Should package-lock.json be published?

What is the difference between npm-shrinkwrap.json and package-lock.json?

After reading the above, one question remains. When to use what where.

When writing a node module that will be published in the npm lifecycle (so others can install npm) shrinkwrap.json

should be used as it can be published.

When writing a node module that you will use in a prodution for your company, etc. that will not be published in the npm lifecycle should be used package-lock.json

.

Tbh reading the other questions might give people an understanding of the mechanics, but for those who just want to take a look at how to use them, I have to ask this direct question.

+3


source to share





All Articles