Skip to content

readJsonSync<T>

Reads a JSON file and parses its contents into a JavaScript object of type T.

Import:

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

Signature:

function readJsonSync(path: string): T

Parameters:

ParameterTypeDescription
pathstringThe path to the JSON file.

Returns: T — The parsed JSON object of type T.