A typical package.json looks something like this,
source code hosted on GitHub
We have recently made changes to package.json so, that is why the version of the library is up to update as of early April in 2020. Notice that the little symbol in front of each versioning. Namely the ^ and ~ (you might not see this symbol in this particular package.json but it is very common)
Here is their definition:
Using the ^ or carat (aka hat) symbol, means to
include everything greater than a particular version in the same major range
For example, “gulp”: “^3.0.1” would mean to inlcude everything from 3.0.1 (including) up to its next major version 4.0.0 (excluding).
Using the ~ or tilde symbol, means to
include everything greater than a particular version in the same minor range
For example, “gulp”: “~3.9.0” would mean to inlcude everything from 3.9.0 (including) up to its next minor version 3.10.0 (excluding).
For more useful symbols like <, >, <=, >=, please visit their website to learn more.
Okay, do let me know in the comments below if you have any questions/concerns and I would be happy to help in any way. Have fun using npm.
Wrapping Up
Hopefully you enjoyed this article and will inspire you to explore more useful JavaScript libraries in npmjs. Let me know if this helps you to clarify. Thank you for reading!
Resources
I’ll try to keep this list current and up to date. If you know of a great resource you’d like to share or notice a broken link, please let us know.
Comments