Skip to main content

Update

Helper functions for updating dependencies in a TypeScript project.

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

packages/complete-node/src/functions/update.ts:25