deno publish command publishes your package to JSR, the JavaScript Registry.
Usage
Description
Publishes packages to JSR. This command handles the entire publishing workflow:- Validates your package configuration
- Runs fast check (by default) to ensure public APIs are well-typed
- Creates and uploads a tarball to JSR
- Optionally generates provenance for supply chain security
deno.json or jsr.json configuration files.
Options
Authentication token for JSR. If not provided, the command will prompt for interactive authentication.
Prepare the package but don’t actually publish it. Useful for testing.
Allow publishing with slow types. By default, the command ensures all public APIs use fast check compatible types for better performance.
Allow publishing with uncommitted changes in the git repository.
Skip generating provenance. By default, provenance is generated on GitHub Actions with OIDC token.
Set the version to publish. Cannot be used when publishing a workspace with multiple packages.
Package Configuration
Yourdeno.json must include:
Required Fields
name: Package name in the format@scope/package-nameversion: Semantic version of the packageexports: Entry point(s) for the package
Optional Fields
Examples
Publish a package (interactive auth)
Dry run to test publishing
Publish with a token
Publish allowing slow types
Publish with uncommitted changes
Set version during publish
Publish workspace packages
For a monorepo with multiple packages:Publishing Workflow
- Configuration Check: Validates
deno.jsonhas required fields - File Collection: Gathers files based on
publish.includeandpublish.exclude - Type Checking: Runs fast check on public APIs (unless
--allow-slow-types) - Graph Analysis: Ensures no excluded modules or invalid imports
- Git Check: Verifies no uncommitted changes (unless
--allow-dirty) - Scope/Package Check: Ensures scope and package exist on JSR
- Tarball Creation: Creates a gzipped tarball of the package
- Upload: Uploads to JSR with authentication
- Provenance: Generates and submits provenance (if on GitHub Actions)
Fast Check
By default, Deno enforces “fast check” for published packages. This ensures:- Public APIs are fully typed
- Types can be checked without executing code
- Better performance for package consumers
- Automatic
.d.tsfile generation for Node.js users
Provenance
When publishing from GitHub Actions with OIDC token support, Deno automatically generates provenance:- Creates a signed attestation of the package
- Publishes to Sigstore transparency log
- Provides supply chain security guarantees
Environment Variables
Skip git dirty check (for testing only).
Disable provenance generation.
Notes
- The first time you publish a scope or package, you’ll need to create it on JSR first
- Packages are immutable once published - you cannot unpublish or modify a published version
- Version numbers must follow semantic versioning
- Package names must be lowercase and can contain letters, numbers, and hyphens