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

std/semver/mod.ts>increment

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

Returns the version incremented by the release type (major, minor, patch, or prerelease), or null if it's not valid.

premajor in one call will bump the version up to the next major version and down to a prerelease of that major version. preminor, and prepatch work the same way.

If called from a non-prerelease version, the prerelease will work the same as prepatch. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it.

Parameters

version: string | SemVer
release: ReleaseType
optional
options: Options
optional
identifier: string

Returns

string | null