Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback


Deno standard library
Go to Latest
function compare
import { compare } from "";

Compare two semantic version objects.

Returns 0 if v1 === v2, or 1 if v1 is greater, or -1 if v2 is greater.

Sorts in ascending order if passed to Array.sort(),


1 | 0 | -1