Skip to content

editPackageLockJson

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

Import:

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

Signature:

function editPackageLockJson(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: