Skip to main content

@std/semver@1.0.3
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.3)
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.

Add Package

deno add jsr:@std/semver

Import symbol

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

---- OR ----

Import directly with a jsr specifier

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

Add Package

npx jsr add @std/semver

Import symbol

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

Add Package

yarn dlx jsr add @std/semver

Import symbol

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

Add Package

pnpm dlx jsr add @std/semver

Import symbol

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

Add Package

bunx jsr add @std/semver

Import symbol

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