Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cijiugechu/nodejs-semver
A node-semver compliant semver implementation in Rust.
https://github.com/cijiugechu/nodejs-semver
javascript nodejs npm parser rust semantic-versioning semver
Last synced: 8 days ago
JSON representation
A node-semver compliant semver implementation in Rust.
- Host: GitHub
- URL: https://github.com/cijiugechu/nodejs-semver
- Owner: cijiugechu
- License: other
- Created: 2023-09-05T12:40:52.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-30T10:39:34.000Z (3 months ago)
- Last Synced: 2024-09-17T23:56:46.448Z (about 2 months ago)
- Topics: javascript, nodejs, npm, parser, rust, semantic-versioning, semver
- Language: Rust
- Homepage:
- Size: 103 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `nodejs-semver`
[![Cargo](https://img.shields.io/crates/v/nodejs-semver.svg)](https://crates.io/crates/nodejs-semver)
[![Documentation](https://docs.rs/nodejs-semver/badge.svg)](https://docs.rs/nodejs-semver)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`.> This project has been forked from [node-semver](https://github.com/felipesere/node-semver-rs) since September of 2023, but a lot has changed; For more details, see [Changelog](https://github.com/cijiugechu/nodejs-semver/blob/main/CHANGELOG.md).
## Usage
`nodejs-semver` includes two main types: [Version] and [Range]. See [the
documentation](https://docs.rs/nodejs-semver) for more details.:```rust
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](https://doc.rust-lang.org/stable/cargo/reference/features.html#the-features-section) that can be enabled:
- **serde**: Provides serialization and deserialization for [Version] and [Range].