Story of ^ and ~ in package.json

Ever wondered what are these characters in your package.json file. Let’s decipher it together. In package.json you write external modules your application depends on. Every module has a release which is in a format 16.0.1. These three digits mean something. 16 is a major release, 0 is a minor release and 1 is for bug fixes/patches. In technical terms its called Semver. For more info follow this link. Say we wanted only minor fixes for a package we will write ^16.0.1 and do npm install. This will only fetch minor releases from the repository instead of the whole thing. If we want just patches then we will write ~16.0.1. If we specify version then we will write nothing just 16.0.1.

Concluding we have three option ^,~ and nothing. Depending on what are the requirements choose the correct version

--

--

--

#IBMER #JS-Advocate #SoftwareEngineer #TechnologyLover #Learner #intermediatetennisplayer #lifebetweenthebraces{}

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Use comments to unit test your code.

Adding Objects to Your Konva Stage via Drag ’n’ Drop in React

Web development project to practice Dom manipulation in JavaScript

Create a form in your HTML document and a heading.

Understand Vue Reactivity Implementation Step by Step

Laravel with Packages | Laravel Dropzone Image Upload Tutorial

Basic React Hooks: useState, useEffect, & useContext

Instantiating Typescript classes using inherited partials

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Akshay Mattoo

Akshay Mattoo

#IBMER #JS-Advocate #SoftwareEngineer #TechnologyLover #Learner #intermediatetennisplayer #lifebetweenthebraces{}

More from Medium

What’s an API Documentation and its benefits?

Set key mapping for YMDK Split keyboard with QMK

L&D series: Pre-commit & Pre-push

How to run ESLint using a pre-commit hook | by Rahul Shetty | Level Up  Coding

How to never add WebStorm .idea folder to git ever again