Home > @infiniteobjects/core-library-node > FileSystem > writeJson
Stringify and write JSON to a file atomically, replacing the file if it already exists.
Signature:
static writeJson(filePath: string, data: unknown): Promise<void>;
| Parameter | Type | Description |
|---|---|---|
| filePath | string | |
| data | unknown |
Returns:
Promise<void>
Creates directories for you as needed.