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

    Function jsonKeyValueParser

    • Parses JSON input and yields key-value pairs for all primitive values. Flattens nested structures using dot notation and array indices.

      Parameters

      • bytes: string | Iterable<number, any, any>

        The JSON input as bytes or string

      Returns Generator<JsonKeyValuePair>

      Key-value pairs as [key, value] tuples

      const json = '{"user": {"name": "John", "age": 30}}';
      for (const [key, value] of jsonKeyValueParser(json)) {
      console.log(`${key}: ${value}`);
      // Output: "user.name: John", "user.age: 30"
      }