writePackageJson
Writes the provided PackageJson object to the package.json file in the specified folder or in the root.
Import:
import { writePackageJson } from 'obsidian-dev-utils/script-utils/npm';Signature:
function writePackageJson(packageJson: PackageJson, cwd: string | undefined): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
packageJson | PackageJson | The PackageJson object to write. |
cwd | string | undefined | The current working folder where package.json is located. |
Returns: Promise<void> — A Promise that resolves when the file has been written.