Bun implements a semantic versioning API which can be used to compare versions and determine if a version is compatible with another range of versions. The versions and ranges are designed to be compatible withDocumentation Index
Fetch the complete documentation index at: https://bun.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
node-semver, which is used by npm clients.
It’s about 20x faster than node-semver.
Bun.semver.satisfies(version: string, range: string): boolean
Returns true if version satisfies range, otherwise false.
Example:
range is invalid, it returns false. If version is invalid, it returns false.
Bun.semver.order(versionA: string, versionB: string): 0 | 1 | -1
Returns 0 if versionA and versionB are equal, 1 if versionA is greater than versionB, and -1 if versionA is less than versionB.
Example: