I'm coming from a background much more familiar with composer
. I'm getting gulp
(etc) going for the build processes and learning node
and how to use npm
as I go.
It's very odd (again, coming from a composer
background) that a composer.lock
-like manifest is not included by default. Having said that, I've been reading documentation on [shrinkwrap], [npm-lockdown], and [npm-seal]. ...and the more documentation I read, the more confused I become as to which I should be choosing (everyone thinks their way is the best way). One of the issues I notice is that npm-seal
hasn't changed in 4 years and npm-lockdown
in 8 months -- this all leads me to wonder if this because it's not needed with the newest version of npm
...
PS: Brownie points if you include the most basic implementation example for each. ;)
NPM shrinkwrap also helps you use same package versions on all environments (development, staging, production) and also improve download and installation speed. Having same versions of packages on all environments can help you test systems and deploy with confidence.
package-lock. json is never published to npm, whereas npm-shrinkwrap is by default. package-lock. json files that are not in the top-level package are ignored, but shrinkwrap files belonging to dependencies are respected.
json , npm-shrinkwrap. json may be included when publishing a package. The recommended use-case for npm-shrinkwrap. json is applications deployed through the publishing process on the registry: for example, daemons and command-line tools intended as global installs or devDependencies .
npm shrinkwrap
is the most standard way how to lock your dependencies. And yes, npm install
does not create it by default which is a pity and it is something that npm creators definitely should change.
npm-lockdown
is trying to do the same things as npm shrinkwrap
, there are two minor points in which npm-lockdown
is better: it handles optional dependencies better and it validates checksums of the package:
https://www.npmjs.com/package/lockdown#related-tools
Both these features seem not so relevant for me; I'm quite happy with npm shrinkwrap
: For example, npmjs guarantees that once you upload certain package at certain version, it stays immutable - so checking sha checksums is not so hot (I've never encountered an error caused by this).
seal
is meant to be used together with npm shrinkwrap
. It adds the 'checksum checking' aspect. It looks abandoned and quite raw.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With