Skip to content

writeJsonSync

Writes a JavaScript object to a JSON file.

Import:

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

Signature:

function writeJsonSync(path: string, data: unknown): void

Parameters:

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

Returns: void