nodejs-semver 4.2.0

A node-semver compliant semver implementation in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use nodejs_semver::Version;
use serde::Serialize;

#[derive(Serialize)]
struct MyVersion {
    version: Version,
    info: String,
}

fn main() {
    let v = "3.4.5-rc.1".parse::<Version>().unwrap();
    let my_version = MyVersion {
        version: v,
        info: "info".to_string(),
    };

    println!("{}", serde_json::to_string(&my_version).unwrap());
}