1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-24 07:55:25 +02:00

semver: add page (#6936)

This commit is contained in:
Pierre Rudloff 2021-10-12 18:34:18 +02:00 committed by GitHub
parent aaed3c64af
commit a25d38a97a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

24
pages/common/semver.md Normal file
View file

@ -0,0 +1,24 @@
# semver
> Semantic version string parser.
> More information: <https://github.com/npm/node-semver>.
- Check if a version string respects the semantic versioning format (prints an empty string if it does not match):
`semver {{1.2}}`
- Convert a version string to the semantic versioning format:
`semver --coerce {{1.2}}`
- Test if `1.2.3` matches the `^1.0` range (prints an empty string if it does not match):
`semver {{1.2.3}} --range "{{^1.0}}"`
- Test with multiple ranges:
`semver {{1.2.3}} --range {{">=1.0"}} {{"<2.0"}}`
- Test multiple version strings and return only the ones that match:
`semver {{1.2.3}} {{2.0.0}} --range "{{^1.0}}"`