Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

std/semver/mod.ts>cmp

Deno standard library
Go to Latest
The Standard Library has been moved to JSR. See the blog post for details.
function cmp
import { cmp } from "https://deno.land/std@0.188.0/semver/mod.ts";

Pass in a comparison string, and it'll call the corresponding comparison function. "===" and "!==" do simple string comparison, but are included for completeness. Throws if an invalid comparison string is provided.

Parameters

v1: string | SemVer
operator: Operator
v2: string | SemVer
optional
options: Options

Returns

boolean