Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cijiugechu/node-semver-rs
A parser for Nodes semver in Rust
https://github.com/cijiugechu/node-semver-rs
Last synced: 8 days ago
JSON representation
A parser for Nodes semver in Rust
- Host: GitHub
- URL: https://github.com/cijiugechu/node-semver-rs
- Owner: cijiugechu
- License: other
- Created: 2023-08-30T08:19:33.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-05T03:25:34.000Z (about 1 year ago)
- Last Synced: 2023-09-05T09:04:14.063Z (about 1 year ago)
- Language: Rust
- Size: 105 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
This crate is a pure Rust-based implementation of JavaScript's
[`node-semver`](https://npm.im/semver). That is, it's designed to be
compatible with Node/NPM's particular flavor of semver (which the [`semver`
crate](https://crates.io/crates/semver) is not).It is designed for Rust programs and libraries meant for JavaScript tooling,
and does its best to stay compatible with `node-semver`.It also supports [`serde`](https://crates.io/crates/serde) serialization,
converting versions and ranges to strings.## Usage
`node-semver` includes two main types: [Version] and [Range]. See [the
documentation](https://docs.rs/node-semver) for more details.:```rust
use node_semver::{Range, Version};let version: Version = "1.2.3".parse().unwrap();
let range: Range = "^1.2".parse().unwrap();assert!(version.satisfies(&range));
```