#semver #javascript #node #range #compatible #tooling #version

node-semver

A node-semver compliant semver implementation in Rust

5 releases (stable)

2.1.0 Sep 21, 2022
2.0.1 Sep 4, 2022
2.0.0 Sep 26, 2021
1.0.1 Sep 24, 2021
0.1.0 May 19, 2021

#287 in Encoding

Download history 3451/week @ 2024-07-31 4007/week @ 2024-08-07 3057/week @ 2024-08-14 2985/week @ 2024-08-21 3630/week @ 2024-08-28 3731/week @ 2024-09-04 3262/week @ 2024-09-11 3648/week @ 2024-09-18 2980/week @ 2024-09-25 2819/week @ 2024-10-02 3091/week @ 2024-10-09 4212/week @ 2024-10-16 3374/week @ 2024-10-23 3945/week @ 2024-10-30 3172/week @ 2024-11-06 2740/week @ 2024-11-13

14,150 downloads per month
Used in 28 crates (16 directly)

Apache-2.0

86KB
2K SLoC

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.

Usage

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));

Dependencies

~2.6–3.5MB
~65K SLoC