Skip to content

editNpmShrinkWrapJson

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

Import:

import { editNpmShrinkWrapJson } from '@mnaoumov/typescript-dev-toolkit/npm';

Signature:

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

Parameters:

Parameter Type Description
editFunction (packageLockJson: PackageLockJson) => Promisable<void> The function to edit the parsed PackageJson object.
options EditPackageJsonOptions Additional options for editing.

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


Links to this page: