Railroad Diagram of version range operators
This is a image version of the post here
range-set:
range-set ::= range ( logical-or range )*
logical-or:
logical-or ::= ' '* '||' ' '*
referenced by: range-set
range:
Railroad Diagram of version range operators
This is a image version of the post here
range-set:
range-set ::= range ( logical-or range )*
logical-or:
logical-or ::= ' '* '||' ' '*
referenced by: range-set
range:
Explaination of version range operators in package.json for package dependencies
To see the syntax and Railroad diagram version, goto here
Package dependecies are a tuple of [major, minor, patch]
with numeric values.
{
"name": "project name",
"version": "0.0.1",
"description": "description of the project",
"keywords": [
"keyword 1",
"keyword 2"
],
"author": "John Doe",
"dependencies": {
"package-1": "~0.6.2",
"package-2": ">=2.6.2"
}
}
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 ranges may be combined in the same way as primitive comparators using space
or ||
.
Update your browser to view this website correctly.&npsb;Update my browser now