guagay_wk
guagay_wk

Reputation: 28090

What is the difference between ~ and ^ in bower.json?

I have this bower.json file.

{
  "name": "angular-seed",
  "description": "A starter project for AngularJS",
  "version": "0.0.0",
  "homepage": "https://github.com/angular/angular-seed",
  "license": "MIT",
  "private": true,
  "dependencies": {
    "angular": "~1.4.0",
    "angular-route": "~1.4.0",
    "angular-loader": "~1.4.0",
    "angular-mocks": "~1.4.0",
    "html5-boilerplate": "~5.2.0",
    "angular-google-chart": "^0.1.0",
    "angular-material": "^1.0.6"
  }
}

For some dependencies, I see ^ as in "angular-material": "^1.0.6". For others, I see ~ as in "html5-boilerplate": "~5.2.0". What is the difference between ^ and ~?

Upvotes: 1

Views: 1134

Answers (1)

Cohars
Cohars

Reputation: 4022

It's all about semver and it actually comes from npm's package.json:

  • ~version is "Approximately equivalent to version"
  • ^version is "Compatible with version"

Upvotes: 4

Related Questions