Skip to content

A node-semver compliant semver implementation in Rust.

License

Notifications You must be signed in to change notification settings

cijiugechu/nodejs-semver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7f64b85 · Dec 26, 2024
Jul 30, 2024
Nov 5, 2024
Apr 8, 2024
Jan 19, 2024
Nov 15, 2024
Sep 24, 2021
Oct 21, 2023
Nov 5, 2024
Dec 26, 2024
Sep 5, 2023
Sep 7, 2021
Jan 6, 2024
Sep 5, 2023
Oct 21, 2023
Oct 21, 2023
Oct 22, 2023

Repository files navigation

nodejs-semver

Cargo Documentation

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.

This project has been forked from node-semver since September of 2023, but a lot has changed; For more details, see Changelog.

Usage

nodejs-semver includes two main types: [Version] and [Range]. See the documentation for more details.:

use nodejs_semver::{Range, Version};

let version: Version = "1.2.3".parse().unwrap();
let range: Range = "^1.2".parse().unwrap();

assert!(version.satisfies(&range));

Optional Features

The following are a list of Cargo features that can be enabled:

  • serde: Provides serialization and deserialization for [Version] and [Range].