Skip to content

Instantly share code, notes, and snippets.

@shhider
Last active May 23, 2019 08:32
Show Gist options
  • Save shhider/569a0959cd6c722115836040ce80581c to your computer and use it in GitHub Desktop.
Save shhider/569a0959cd6c722115836040ce80581c to your computer and use it in GitHub Desktop.
[about npm package.json] #nodejs #npm

The tilde ~ matches the most recent patch version (the third number) for the specified minor version (the second number). ~1.2.3 will match all 1.2.x versions but will hold off on 1.3.0.

The caret ^ is more relaxed. It matches the most recent minor version (the second number) for the specified major version (the first number). ^1.2.3 will match any 1.x.x release including 1.3.0, but will hold off on 2.0.0.

Reference

https://docs.npmjs.com/files/package.json#dependencies

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment