writeJson
Writes a JavaScript object to a JSON file.
Import:
import { writeJson } from '@mnaoumov/typescript-dev-toolkit/json';Signature:
function writeJson(path: string, data: unknown): Promise<void>Parameters:
| Parameter | Type | Description |
|---|---|---|
path |
string | The path to the JSON file. |
data |
unknown | The data to write to the JSON file. |
Returns: Promise<void> — A Promise that resolves when the file has been written.