@zuke/jsr

← API reference

`@zuke/jsr` — tools for the [JSR](https://jsr.io) registry in Zuke builds:

Symbols

# isPublished function
async function isPublished(pkg: string, version: string, options?: JsrRegistryOptions): Promise<boolean>

Whether pkg@version (e.g. @zuke/core, 0.13.0) is already on JSR.

# JsrAddSettings class
class JsrAddSettings extends JsrSettings

Settings for jsr add (install a JSR dependency).

MemberSignatureDoc
packages packages(...specs: string[]): this Package specs to add, e.g. @std/assert (required).
dev dev(): this Add as a development dependency (--save-dev).
# JsrPublishSettings class
class JsrPublishSettings extends JsrSettings

Settings for jsr publish.

MemberSignatureDoc
dryRun dryRun(): this Validate without publishing (--dry-run).
allowSlowTypes allowSlowTypes(): this Permit slow types in the published package (--allow-slow-types).
allowDirty allowDirty(): this Publish even with an uncommitted working tree (--allow-dirty).
noCheck noCheck(): this Skip type-checking before publishing (--no-check).
provenance provenance(): this Attach provenance attestation in CI (--provenance).
token token(value: string): this Authenticate with a token instead of the interactive flow (--token).
# JsrRegistryOptions interface
interface JsrRegistryOptions

Options shared by the JSR registry helpers.

MemberSignatureDoc
fetch? fetch?: fetch The fetch implementation to use. Defaults to the global fetch; override it to unit-test without network access.
# JsrRemoveSettings class
class JsrRemoveSettings extends JsrSettings

Settings for jsr remove.

MemberSignatureDoc
packages packages(...names: string[]): this Package names to remove (required).
# JsrSettings class
class JsrSettings extends ToolSettings

Base for all jsr subcommand settings: the binary is jsr.

# JsrTasks const
const JsrTasks: JsrTasksApi

Typed task functions for the jsr CLI.

# JsrTasksApi interface
interface JsrTasksApi

The shape of JsrTasks.

MemberSignatureDoc
publish publish(configure?: Configure<JsrPublishSettings>): Promise<CommandOutput> Publish the package: jsr publish.
add add(configure?: Configure<JsrAddSettings>): Promise<CommandOutput> Add a JSR dependency: jsr add.
remove remove(configure?: Configure<JsrRemoveSettings>): Promise<CommandOutput> Remove a dependency: jsr remove.
# jsrVersions function
async function jsrVersions(pkg: string, options?: JsrRegistryOptions): Promise<Set<string>>

The set of published versions of pkg (a scoped name like @zuke/core). Resolves to an empty set if the package is not found on JSR.

# publishedVersions function
function publishedVersions(meta: unknown): Set<string>

The set of version strings present in a JSR meta.json payload. Tolerant of malformed input: anything without a versions object yields an empty set.