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

    Function writePackageJson

    • Writes a package.json file with write-package.

      The file is written atomically and missing directories are created. An existing file keeps its indentation and its trailing newline or lack of one. Empty dependency objects are removed and dependencies are sorted alphabetically.

      Parameters

      • path: string

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

      • packageJson: PackageJson

        The package.json object to write.

      • options: WritePackageJsonOptions = {}

        Options for writing.

      Returns Promise<void>

      An error if the file cannot be written.