kinetex - v1.0.0-rc.1
    Preparing search index...

    Function readNDJSON

    • Parse a streaming NDJSON (newline-delimited JSON) response.

      Type Parameters

      • T = unknown

      Parameters

      • response: Response

        The fetch Response.

      • options: ResponseParseOptions & { onParseError?: (err: unknown, line: string) => void } = {}

        Parse options + optional onParseError for malformed lines.

      Returns AsyncGenerator<T>

      Each parsed JSON object as type T.