Skip to main content
On this page

deno publish publishes your package to the JSR registry.

Package Requirements Jump to heading

Your package must have a name and version and an exports field in its deno.json or jsr.json file.

  • The name field must be unique and follow the @<scope_name>/<package_name> convention.
  • The version field must be a valid semver version. To bump it as part of your release flow, see deno bump-version.
  • The exports field must point to the main entry point of the package. The exports field can either be specified as a single string, or as an object mapping entrypoint names to paths in your package.

Example:

deno.json
{
  "name": "@scope_name/package_name",
  "version": "1.0.0",
  "exports": "./main.ts"
}

Before you publish your package, you must create it in the registry by visiting JSR - Publish a package.

Excluding a workspace member Jump to heading

When run inside a workspace, deno publish tries to publish every member that has a name and exports, and errors if any of them is missing a version. To opt a member out, for example an internal helper package that only exists to host shared tasks, set "publish": false in that member's deno.json:

internal-helpers/deno.json
{
  "name": "@scope/internal-helpers",
  "publish": false
}

The member stays part of the workspace but is skipped by deno publish. See Excluding a workspace member from publish for the full discussion.

Examples Jump to heading

Publish your current workspace

›_
deno publish

Publish your current workspace with a specific token, bypassing interactive authentication

›_
deno publish --token c00921b1-0d4f-4d18-b8c8-ac98227f9275

Publish and check for errors in remote modules

›_
deno publish --check=all

Perform a dry run to simulate publishing.

›_
deno publish --dry-run

Publish using settings from a specific configuration file

›_
deno publish --config custom-config.json
Command line usage:
publish

Publish the current working directory's package or workspace

Options Jump to heading

--allow-dirty
Jump to heading

Allow publishing if the repository has uncommitted changed.

--allow-slow-types
Jump to heading

Allow publishing with slow types.

Load certificate authority from PEM encoded file.

Set type-checking behavior. This subcommand type-checks local modules by default, so passing --check is redundant; pass --check=all to also type-check remote modules. Alternatively, use the 'deno check' subcommand.

Configure different aspects of deno including TypeScript, linting, and code formatting. Typically the configuration file will be called deno.json or deno.jsonc and automatically detected; in that case this flag is not necessary.

Prepare the package for publishing performing all checks and validations without uploading.

Load environment variables from local file Only the first environment variable with a given key is used. Existing process environment variables are not overwritten, so if variables with the same names already exist in the environment, their values will be preserved. Where multiple declarations for the same environment variable exist in your .env file, the first one encountered is applied. This is determined by the order of the files you pass as arguments.

--frozen-lockfile
Jump to heading

Error out if lockfile is out of date.

Load import map file from local file or remote URL.

Check the specified lock file. (If value is not provided, defaults to "./deno.lock").

--min-dep-age
Jump to heading

(Unstable) The age in minutes, ISO-8601 duration or RFC3339 absolute timestamp (e.g. '120' for two hours, 'P2D' for two days, '2025-09-16' for cutoff date, '2025-09-16T12:00:00+00:00' for cutoff time, '0' to disable).

Skip type-checking. If the value of "remote" is supplied, diagnostic errors from remote modules will be ignored.

--no-config
Jump to heading

Disable automatic loading of the configuration file.

Disable auto discovery of the lock file.

Do not resolve npm modules.

--no-provenance
Jump to heading

Disable provenance attestation. Enabled by default on Github actions, publicly links the package to where it was built and published from.

--no-remote
Jump to heading

Do not resolve remote modules.

--node-modules-dir
Jump to heading

Selects the node_modules directory mode for npm packages (not a path). One of: auto (create a local node_modules directory and install npm packages into it), manual (use the existing local node_modules directory, do not modify it), none (do not use a local node_modules directory; resolve npm packages from the global cache). Defaults to auto when the flag is passed without a value.

--node-modules-linker
Jump to heading

Sets the linker mode for npm packages (isolated or hoisted).

--reload, -r
Jump to heading

Reload source code cache (recompile TypeScript). With no value, reloads everything. Pass a comma-separated list of specifiers to reload only those modules; npm: reloads all npm modules; npm:chalk reloads a single npm module; jsr:@std/http/file-server,jsr:@std/assert/assert-equals reloads specific modules.

--set-version
Jump to heading

Set version for a package to be published. This flag can be used while publishing individual packages and cannot be used in a workspace.

The API token to use when publishing. If unset, interactive authentication is be used.

--unsafely-ignore-certificate-errors
Jump to heading

DANGER: Disables verification of TLS certificates.

Toggles local vendor folder usage for remote modules and a node_modules folder for npm packages.

Last updated on

Did you find what you needed?

Edit this page
Privacy policy