For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/reference/sdk/node/config/functions/readJson.md.
  • English
  • Function: readJson()

    function readJson<T>(filePath: string, fallback?: T): T | undefined;

    Defined in: node/config/index.ts:396

    同步读取 JSON 文件;失败时返回 fallback 或 undefined。

    Type Parameters

    Type Parameter
    T

    Parameters

    ParameterType
    filePathstring
    fallback?T

    Returns

    T | undefined