@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). Registered with the run's redactor, so every *rendering* of the command masks it — a dry-run echo, a failure message. That is as far as it goes: jsr publish accepts the token only as a flag, so the value still reaches the child's argv, where ps and /proc/<pid>/cmdline expose it to every other user on the host and to every process the build starts. There is no environment variable to move it to. On GitHub Actions, prefer OIDC and pass no token at all: the publish is authenticated by the workflow's identity, so there is no credential to expose. This is for the cases where that is not available.
#

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.