Skip to content

writeJson

Writes a JavaScript object to a JSON file.

Import:

import { writeJson } from 'obsidian-dev-utils/script-utils/json';

Signature:

function writeJson(path: string, data: unknown): Promise<void>

Parameters:

ParameterTypeDescription
pathstringThe path to the JSON file.
dataunknownThe data to write to the JSON file.

Returns: Promise<void> — A Promise that resolves when the file has been written.