Crates.io | node-semver |
lib.rs | node-semver |
version | 2.1.0 |
source | src |
created_at | 2021-05-19 00:48:25.516819 |
updated_at | 2022-09-21 02:32:56.617177 |
description | A node-semver compliant semver implementation in Rust. |
homepage | |
repository | https://github.com/felipesere/node-semver-rs |
max_upload_size | |
id | 399218 |
size | 102,557 |
This crate is a pure Rust-based implementation of JavaScript's
node-semver
. That is, it's designed to be
compatible with Node/NPM's particular flavor of semver (which the semver
crate 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
serialization,
converting versions and ranges to strings.
node-semver
includes two main types: [Version] and [Range]. See the
documentation for more details.:
use node_semver::{Range, Version};
let version: Version = "1.2.3".parse().unwrap();
let range: Range = "^1.2".parse().unwrap();
assert!(version.satisfies(&range));