Skip to main content

latest

CLI to update version of Deno project similarly to how `npm version` would do it.

This package works with Deno
This package works with Deno
JSR Score
94%
Published
3 hours ago (1.1.0)

pipeline status jsr license) documentation

CLI to update version of Deno project similarly to how npm version would do it.

npm version is a very useful tool for updating the version of NPM modules. Currently Deno is lacking a similar functionality or tool.

This package does exactly what npm version would do for Node and the package.json, but for Deno and the deno.json(c). It does:

  • update the version according to semantic versioning in deno.json, deno.jsonc or jsr.json (in that order) and optionally in package.json, if it exists
  • run lifecycle hooks (Deno tasks, NPM scripts too, if package.json exists), useful to generate a changelog for example
    • preversion before changing the version
    • version after changing the version, before committing the changes
    • postversion after committing and tagging
  • Git commit the changes
  • Git tag the commit

Permissions and their intents

Flag Value Intent
--allow-read $PWD to read version and tasks from deno.json(c) in the current working directory
--allow-write $PWD to write the updated version to deno.json(c) in the current working directory
--allow-run git to add version specific changes to git, commit and tag them
deno to run Deno tasks as hooks
npm to run NPM scripts/hooks

Examples

Minor version bump

deno run jsr:@krlwlfrt/version minor

Premajor version bump with specified prerelease

deno run jsr:@krlwlfrt/version premajor --prerelease alpha

Set specific version

deno run jsr:@krlwlfrt/version 1.33.4

Output package and runtime versions

deno run jsr:@krlwlfrt/version

Add Package

deno add jsr:@krlwlfrt/version

Import symbol

import * as version from "@krlwlfrt/version";

---- OR ----

Import directly with a jsr specifier

import * as version from "jsr:@krlwlfrt/version";