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/patchJson.md.
  • English
  • Function: patchJson()

    function patchJson<T>(filePath: string, partial: Partial<T>): T;

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

    浅合并:读出现有 JSON,与 partial 合并,原子写回。 文件不存在视为 {}。

    Type Parameters

    Type Parameter
    T extends object

    Parameters

    ParameterType
    filePathstring
    partialPartial<T>

    Returns

    T