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

std/semver/mod.ts>compare

Deno standard library
Go to Latest
function compare
Re-export
import { compare } from "https://deno.land/std@0.202.0/semver/mod.ts";

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(),

Returns

1 | 0 | -1