Creates a new key-value parser.
Optionalbuffer: ByteStream | ByteBufferOptional ByteBuffer or ByteStream to read from
Optionalcontainer: JsonObject<any> | JsonArray<any> | JsonValue<any, string>The JSON container to parse (object, array, or value)
OptionalparentKey: stringThe parent key for nested structures (used for dot notation)
Gets the current length of the buffer.
The number of bytes in the buffer
Gets the type name of this entity.
The constructor name of this entity
Sets the maximum buffer size before compaction occurs.
The maximum buffer size in bytes
Returns an async iterator for key-value pairs. Enables use of for await...of loops on JsonKeyValueParser.
Returns an iterator for key-value pairs. Enables use of for...of loops on JsonKeyValueParser.
Consumes the entity by reading it if not already consumed.
Asynchronously consumes the entity by reading it if not already consumed.
Feeds input data into the buffer.
One or more strings, numbers, arrays of numbers, or Uint8Arrays to add to the buffer
Generator that yields key-value pairs from the JSON structure. Flattens nested objects and arrays using dot notation and array indices.
Async generator that yields key-value pairs from a stream.
Asynchronously reads and parses the entity from a stream.
A promise that resolves to the parsed value
ProtectedskipSkips whitespace characters in the buffer.
Attempts to parse by executing a callback, reverting buffer state on failure.
The return type of the callback
The callback function to execute
The result of the callback, or undefined if parsing needs more data
Parser that flattens nested JSON structures into key-value pairs. Useful for extracting specific values from complex JSON without parsing the entire structure.