1

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 ~?

guagay_wk
  • 26,337
  • 54
  • 186
  • 295

1 Answers1

4

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"
Cohars
  • 3,822
  • 1
  • 29
  • 50