publish()
Publish packages to npm programmatically.
Signature
ts
function publish(options?: PublishOptions): Promise<void>Options
ts
interface PublishOptions {
registry?: string
/**
* Additional registries to publish to, on top of `registry`. See the
* [publish config reference](../config/publish.md#registries) for details.
* @default undefined
*/
registries?: RegistryTarget[]
tag?: string
access?: 'public' | 'restricted'
otp?: string
/**
* Glob pattern matching for packages to publish.
* @default undefined
*/
packages?: string[]
/**
* Command to build your packages before publishing.
* @default undefined
*/
buildCmd?: string
dryRun?: boolean
config?: ResolvedRelizyConfig
bumpedPackages?: PackageInfo[]
logLevel?: LogLevel
configName?: string
}Example
ts
import { publish } from 'relizy'
await publish({
tag: 'latest',
access: 'public',
dryRun: false,
buildCmd: 'pnpm build',
})