3

Should package-lock.json also 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 which will be published to the npm lifecycle (so others can npm install it), shrinkwrap.json should be used, since it can be published.

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

Tbh reading the other questions might give people insight in the mechanics, but for those who want a simple view of how to use them, I must ask this straight forward question.

basickarl
  • 37,187
  • 64
  • 214
  • 335
  • Take a look here: http://jpospisil.com/2017/06/02/understanding-lock-files-in-npm-5.html – danieleds Jul 29 '17 at 14:54
  • I've voted to close this as a duplicate because my answer at https://stackoverflow.com/a/46132512/1709587 (which was added there *after* Karl asked here - he did nothing wrong by asking) directly addresses the question of which file to use when. As such, https://stackoverflow.com/q/44258235/1709587 has effectively become a duplicate of this question in the time since it was asked. – Mark Amery Nov 17 '17 at 18:18

0 Answers0