json-stream-lite - v1.0.17
    Preparing search index...

    Function jsonKeyValueParserAsync

    • Asynchronously parses JSON input from various sources and yields key-value pairs. Supports streaming from async iterables and ReadableStreams for memory-efficient parsing.

      Parameters

      • bytes:
            | string
            | Iterable<number, any, any>
            | AsyncIterable<number, any, any>
            | ReadableStream<number>
            | ReadableStream<Uint8Array<ArrayBufferLike>>
            | ReadableStream<string>

        The JSON input as bytes, string, or stream

      Returns AsyncGenerator<JsonKeyValuePair>

      Key-value pairs as [key, value] tuples

      const stream = fs.createReadStream('large.json');
      for await (const [key, value] of jsonKeyValueParserAsync(stream)) {
      console.log(`${key}: ${value}`);
      }