Reads a JSON file and parses its content.
The expected type of the parsed JSON object.
The path of the JSON file to read.
A promise that resolves to an AsyncIOResult containing the parsed JSON object.
AsyncIOResult
1.8.4
interface Config { name: string; version: number;}(await readJsonFile<Config>('/config.json')) .inspect(config => console.log(config.name)); Copy
interface Config { name: string; version: number;}(await readJsonFile<Config>('/config.json')) .inspect(config => console.log(config.name));
Reads a JSON file and parses its content.