Skip to content

publish

Publish to NPM.

Authentication is intentionally not handled here. The publish is expected to run from a CI job configured as a trusted publisher on npmjs.com, where the npm CLI exchanges the job’s short-lived OIDC token for a publish grant on its own. No NPM token is read, written, or stored, and the published package gets provenance for free.

Requires npm 11.5.1 or later.

Import:

import { publish } from 'obsidian-dev-utils/script-utils/npm-publish';

Signature:

function publish(isBeta: boolean | undefined): Promise<void>

Parameters:

ParameterTypeDescription
isBetaboolean | undefinedWhether to publish to the beta NPM registry.

Returns: Promise<void>