Skip to content

writePackageLockJson

Writes the provided PackageJson object to the package-lock.json file in the specified folder or in the root.

Import:

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

Signature:

function writePackageLockJson(packageLockJson: PackageLockJson, cwd: string | undefined): Promise<void>

Parameters:

ParameterTypeDescription
packageLockJsonPackageLockJsonThe PackageLockJson object to write.
cwdstring | undefinedThe current working folder where package-lock.json is located.

Returns: Promise<void> — A Promise that resolves when the file has been written.