node-js-release-info
Asynchronously retrieve Node.js release info by version and platform from the downloads server
Installation
cargo add node-js-release-info
Examples
This example uses Tokio, be sure to install it with:
cargo add tokio --features full
use ;
async
Features
Full json serialization + deserialization is available via the json feature.
cargo add node-js-release-info --features json
use NodeJsRelInfo;
async
Migrations
Type and variant names now follow RFC 430
| before | after |
|---|---|
NodeJSRelInfo |
NodeJsRelInfo |
NodeJSRelInfoError |
NodeJsRelInfoError |
NodeJSOS |
NodeJsOs |
NodeJSArch |
NodeJsArch |
NodeJSPkgExt |
NodeJsPkgExt |
NodeJSOS::AIX |
NodeJsOs::Aix |
NodeJSArch::ARM64 |
NodeJsArch::Arm64 |
NodeJSArch::ARMV7L |
NodeJsArch::Armv7l |
NodeJSArch::PPC64 |
NodeJsArch::Ppc64 |
NodeJSArch::PPC64LE |
NodeJsArch::Ppc64le |
NodeJSArch::S390X |
NodeJsArch::S390x |
Builder methods consume self
They now return an owned value directly, so the trailing to_owned() is no longer needed - and NodeJsRelInfo::to_owned() has been removed. Use .clone() if you want a copy.
// before
let info = new.macos.arm64.to_owned;
// after
let info = new.macos.arm64;
Calling a builder as a statement no longer works, since it takes self:
// before
let mut info = new;
info.macos;
// after
let info = new.macos;
fetch() consumes self
It previously mutated in place and returned a clone. It now takes self and returns the populated value:
// before
let mut info = new;
info.fetch.await?; // `info` updated in place
// after
let info = new.fetch.await?;
Enums are #[non_exhaustive]
NodeJsOs, NodeJsArch, NodeJsPkgExt and NodeJsRelInfoError may gain variants in a minor release, so a match over them needs a _ arm. Node.js adds and removes target platforms over time, and this keeps that from being a breaking change.
Error messages changed
The Error: prefix is gone and messages are lowercased, per API guideline C-GOOD-ERR. Previously they composed into chains as Error: Error: ....
before: Error: Invalid Version! Received: 'x'
after: invalid version - received: 'x'
NodeJsRelInfoError also implements Error::source() now, exposing the underlying reqwest::Error behind HttpError.
New variants
NodeJsOs::SunOs (sunos) and NodeJsArch::Armv6l (armv6l) were missing. Both appear in older Node.js releases, so fetching those versions previously failed with UnrecognizedOs / UnrecognizedArch on valid artifacts.
Note that Node.js v24 dropped linux-armv7l and all 32-bit Windows builds, so fetch_all returns 19 configurations for v24 where v20 returned 24.