Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alilleybrinker/semver-explain
Explain semver requirements by converting them into less than, greater than, and/or equal to form.
https://github.com/alilleybrinker/semver-explain
cli semver
Last synced: 2 months ago
JSON representation
Explain semver requirements by converting them into less than, greater than, and/or equal to form.
- Host: GitHub
- URL: https://github.com/alilleybrinker/semver-explain
- Owner: alilleybrinker
- License: mit
- Created: 2021-11-17T12:10:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T21:36:43.000Z (12 months ago)
- Last Synced: 2024-10-11T12:19:53.422Z (3 months ago)
- Topics: cli, semver
- Language: Rust
- Homepage: https://crates.io/crates/semver-explain
- Size: 19.5 KB
- Stars: 31
- Watchers: 2
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `semver-explain`
__Convert SemVer requirements to their most-obvious equivalents.__
`semver-explain` is a CLI tool to explain Semantic Versioning requirements by converting them to a form with only less-than, greater-than and/or equal-to comparators, where the major, minor, and patch versions are all specified.
The exact interpretation of SemVer requirements' meaning [comes from Cargo][cargo_semver]. In particular, it does not handle [hyphen ranges or x-ranges][node_semver] from the `node-semver` library for JavaScript.
## Why?
It's easy to forget the exact meaning of SemVer comparators like `~`, `^`, and `*`. Rather than looking up documentation to confirm what's meant by a requirement, you can plug it into `semver-explain` and get a set of more-obvious equivalent requirements!
## Examples
```sh
$ semver-explain "^1.4.0"
>=1.4.0, <2.0.0
$ semver-explain "~0.5.3"
>=0.5.3, <0.6.0
$ semver-explain "5.6.*"
>=5.6.0, <5.7.0
```## Installation
`semver-explain` is written in Rust, so you'll need to [install Rust][install_rust] first.
```sh
# To install from Crates.io
$ cargo install semver-explain
# To install from source (after cloning or downloading)
$ cargo install --path ""
```## How to Use
Just give it a SemVer requirement as a string! The CLI is purposefully simple.
```
semver-explain 0.2.0USAGE:
semver-explainFLAGS:
-h, --help Prints help information
-V, --version Prints version informationARGS:
semantic versioning requirement to explain
```## License
`semver-explain` is MIT licensed. The full license text can be found in `LICENSE.md`.
## Thanks
This tool uses the excellent Rust [`semver`][semver] library, without which it would have been much more tedious to build.
[cargo_semver]: https://doc.rust-lang.org/cargo/reference/specifying-dependencies.html "Link to Cargo's explanation of semver requirements"
[node_semver]: https://github.com/npm/node-semver#advanced-range-syntax "Link to node-semver's range syntax"
[install_rust]: https://www.rust-lang.org/tools/install "Link to Rust installation instructions."
[semver]: https://crates.io/crates/semver "Link to the semver crate"