balena-semver, currently at version 4.0.18, provides a collection of Balena-specific utility methods for working with semantic versions. While it parses and adheres to standard semver strings, its key differentiator is its ability to handle Balena OS version formats, such as 'Resin OS vX.Y.Z'. The package maintains a frequent release cadence, primarily issuing patch updates as seen with numerous recent v4.0.x releases. This module is explicitly noted as a low-level utility intended for internal Balena components and is generally not recommended for direct use by end-users; instead, the Balena SDK is suggested for most applications. It ships with TypeScript types, facilitating its use in modern JavaScript and TypeScript projects. The package requires Node.js versions `^20.12.0 || >= 22.0.0`.
npm install balena-semverVerified import paths — ran on the pinned version, not inferred.
Demonstrates basic usage including comparing different version formats, satisfying ranges, and extracting version components.
Consider using the higher-level Balena SDK for application development unless you explicitly require these specific, low-level semver utilities.
Ensure your project uses Node.js version 20.12.0 or higher, or Node.js 22.0.0 or higher, to maintain compatibility and stability.
Remove any 'v' prefixes from version strings in `balena.yml` (e.g., use `version: '1.2.3'` instead of `version: 'v1.2.3'`).
Be aware that build metadata is purely informational and does not affect release uniqueness or comparison logic within the Balena ecosystem's versioning enforcement.
Ensure version strings do not contain a 'v' prefix. Use '1.2.3' instead of 'v1.2.3'.
Always check for `null` or `undefined` return values when calling `balena-semver` functions that can fail parsing, such as `parse(version)` or `major(version)`. Handle cases where the input version string is not a valid semantic version or Balena-specific version.
No dependency data recorded yet.