Explaination of version range operators in package.json for package dependencies
To see the syntax and Railroad diagram version, goto here
Basic Structure
Package dependecies are a tuple of [major, minor, patch]
with numeric values.
1 |
|
Version Range operator
Basic Range
For x
in exmaple, see Advanced Range below.
Operator | Explaination | Example |
---|---|---|
= |
package version must be exactly matched | 1.0.0 := =1.0.0 (They are equivalent) |
< |
package version must be less than indicated | <2.0.0 :=version from 0.0.1 to 1.x.x |
<= |
package version must be less than or euqal to indicated | <=2.0.0 :=version from 0.0.1 to 2.0.0 |
> |
package version must be greater than indicated | >2.0.0 := version from 2.0.1 to x (x >= 2) |
>= |
package version must be greater than or euqal to indicated | >=2.0.0 :=version from 2.0.0 to x (x >= 2) |
|| |
joined one or more operator | >2.0.1 || <1.7.3 :=version greater than 2.0.1 or less than 1.7.3 |
space |
Intersected one or more operator | >=2.0.1 <=1.7.3 :=version from 2.0.1 to 1.7.3 (inclusive) |
Advanced Range
Advanced ranges may be combined in the same way as primitive comparators using space
or ||
.