1 ---
2 title: About semantic versioning
3 redirect_from:
4 - /getting-started/semantic-versioning/
5 ---
6
7 To keep the JavaScript ecosystem healthy, reliable, and secure, every time you make significant updates to an npm package you own, we recommend publishing a new version of the package with an updated version number in the [`package.json` file][pkg-json] that follows the [semantic versioning spec][semver-org]. Following the semantic versioning spec helps other developers who depend on your code understand the extent of changes in a given version, and adjust their own code if necessary.
8
9 <Note>
10
11 **Note:** If you introduce a change that breaks a package dependency, we strongly recommend incrementing the version **major number**; see below for details.
12
13 </Note>
14
15 ## Incrementing semantic versions in published packages
16
17 To help developers who rely on your code, we recommend starting your package version at `1.0.0` and incrementing as follows:
18
19 <DataTable
20 headers={["Code status", "Stage", "Rule", "Example version"]}
21 rows={[
22 ["First release", "New product", "Start with 1.0.0", "1.0.0"],
23 ["Backward compatible bug fixes", "Patch release", "Increment the third digit", "1.0.1"],
24 ["Backward compatible new features", "Minor release", "Increment the middle digit and reset last digit to zero", "1.1.0"],
25 ["Changes that break backward compatibility", "Major release", "Increment the first digit and reset middle and last digits to zero", "2.0.0"]
26 ]}
27 />
28
29 ## Using semantic versioning to specify update types your package can accept
30
31 You can specify which update types your package can accept from dependencies in your package's `package.json` file.
32
33 For example, to specify acceptable version ranges up to 1.0.4, use the following syntax:
34
35 - Patch releases: `1.0` or `1.0.x` or `~1.0.4`
36 - Minor releases: `1` or `1.x` or `^1.0.4`
37 - Major releases: `*` or `x`
38
39 For more information on semantic versioning syntax, see the [npm semver calculator][semver-calc].
40
41 ### Example
42
43 ```json
44
45 "dependencies": {
46 "my_dep": "^1.0.0",
47 "another_dep": "~2.2.0"
48 },
49 ```
50
51 ## Resources
52
53 <YouTube id="kK4Meix58R4" />
54
55 [semver-calc]: https://semver.npmjs.com/
56 [pkg-json]: creating-a-package-json-file
57 [semver-org]: http://semver.org/
58 [semver-video]: https://www.youtube.com/embed/kK4Meix58R4