Semver Ranges (^ ~) Playground

Dodi’s parts shelf: 45 versions of chalk really published on npm. Type a range (^, ~, x, prereleases), see which boxes a port of node-semver lets in, and the…

Why it matters

A range decides which updates slip in when someone else runs npm install. Misreading ^ and ~, or ^ on 0.x, means a build that breaks out of nowhere or a fix that never arrives. Knowing the prerelease rule and how npm picks explains why a beta stays out, and why two laptops can install different versions.

The key idea

A range picks a set of versions; npm picks one from the set

Common mistakes

Try it in this playground