happy-opfs
    Preparing search index...

    Function readJsonFile

    • Reads a JSON file and parses its content.

      Type Parameters

      • T

        The expected type of the parsed JSON object.

      Parameters

      • filePath: string

        The path of the JSON file to read.

      Returns AsyncIOResult<T>

      A promise that resolves to an AsyncIOResult containing the parsed JSON object.

      1.8.4

      interface Config {
      name: string;
      version: number;
      }
      (await readJsonFile<Config>('/config.json'))
      .inspect(config => console.log(config.name));