Skip to content

editNpmShrinkWrapJson

Reads, edits, and writes back the package-lock.json file using the provided edit function.

Import:

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

Signature:

function editNpmShrinkWrapJson(editFn: (packageLockJson: PackageLockJson) => Promisable<void>, options: EditPackageJsonOptions): Promise<void>

Parameters:

ParameterTypeDescription
editFn(packageLockJson: PackageLockJson) => Promisable<void>The function to edit the parsed PackageJson object.
optionsEditPackageJsonOptionsAdditional options for editing.

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


Links to this page: