Skip to main content

functions/update

Functions

updatePackageJSONDependencies()

function updatePackageJSONDependencies(
filePathOrDirPath,
installAfterUpdate,
quiet): boolean

Helper function to run npm-check-updates to update the dependencies in the "package.json" file. If there are any updates, the package manager used in the project will be automatically invoked.

Parameters

ParameterTypeDefault valueDescription
filePathOrDirPathundefined | stringundefinedEither the path to a "package.json" file or the path to a directory which contains a "package.json" file. If undefined is passed, the current working directory will be used.
installAfterUpdatebooleantrueOptional. Whether to install the new dependencies afterward, if any. Default is true.
quietbooleanfalseOptional. Whether to suppress console output. Default is false.

Returns

boolean

Whether the "package.json" file was updated.

Defined in

functions/update.ts:18