Skip to main content
Home

@std/semver@1.0.5
Built and signed on GitHub Actions

Parsing and comparing of semantic versions (SemVer)

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 months ago (1.0.5)
function format
format(version: SemVer): string

Format a SemVer object into a string.

Examples

Usage

import { format } from "@std/semver/format";
import { assertEquals } from "@std/assert";

const semver = {
  major: 1,
  minor: 2,
  patch: 3,
};
assertEquals(format(semver), "1.2.3");

Parameters

version: SemVer

The SemVer to format

Return Type

The string representation of a semantic version.

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@std/semver

Import symbol

import { format } from "@std/semver/format";
or

Import directly with a jsr specifier

import { format } from "jsr:@std/semver/format";

Add Package

pnpm i jsr:@std/semver
or (using pnpm 10.8 or older)
pnpm dlx jsr add @std/semver

Import symbol

import { format } from "@std/semver/format";

Add Package

yarn add jsr:@std/semver
or (using Yarn 4.8 or older)
yarn dlx jsr add @std/semver

Import symbol

import { format } from "@std/semver/format";

Add Package

vlt install jsr:@std/semver

Import symbol

import { format } from "@std/semver/format";

Add Package

npx jsr add @std/semver

Import symbol

import { format } from "@std/semver/format";

Add Package

bunx jsr add @std/semver

Import symbol

import { format } from "@std/semver/format";