Package-JSON

package.json

  • heart of any Node project
  • contains metadata + functional attributes
  • metadata which is required before publishing to NPM
  • functional attributes of a project - npm uses to install dependencies, run scripts, and identify the entry point to our package.

Handling versions

  • Caret (^): This allows your app to get automatic updates for minor and patch versions of a package. For example: "react": "^17.0.0" means it can update to any version like 17.0.1 or 17.1.0, but not 18.0.0. It’s like upgrading your phone’s software—new features and bug fixes, but no big surprises!
  • Tilde (~): This one’s a bit stricter. It only allows updates for patch versions. For example: "react": "~17.0.0" means it can only update to 17.0.1, but not 17.1.0. Think of it as sticking to bug fixes and avoiding any new features for now.

References

What is package.json? - heynode Symbols in package JSON - LinkedIn Post

© 2025 All rights reservedBuilt with Flowershow Cloud

Built with LogoFlowershow Cloud