Skip to content

readJson<T>

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

Import:

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

Signature:

function readJson(path: string): Promise<T>

Parameters:

ParameterTypeDescription
pathstringThe path to the JSON file.

Returns: Promise<T> — A Promise that resolves with the parsed JSON object of type T.