Documentation for Simbo's Packages
    Preparing search index...

    Function updatePackageJson

    • Updates an existing package.json file.

      Reads the file, passes its content to the updater, and writes the result as writePackageJson does. The updater changes the object in place or returns a new one, so it can also remove keys or replace arrays.

      Parameters

      • path: string

        The path to the package.json file or its directory.

      • update: PackageJsonUpdater

        A function that changes or replaces the package.json object.

      • options: WritePackageJsonOptions = {}

        Options for writing.

      Returns Promise<void>

      An error if the file cannot be read or written, or the error of the updater.