Progressive JSON parser v0.1.1
Build JSON objects
progressively
Read the object while input is still arriving.
function parse(
chunks: AsyncIterable<string>,
host?: object,
property?: string
): Promise<JsonValue>;
npm install gradual-json{{ parts.slice(0, Math.max(0, step - 1)).join('') }}{{ parts[step - 1] }}
parse(chunks(), host, "data")host.data{{ complete ? 'Complete object' : 'Building' }}{{ error }}
Integration examples
Use it in different scenarios
Receive input from HTTP or SSE.
Write into Vue objects or record commands with a Proxy.
{{ current.title }}
{{ current.description }}
{{ part }}{{ current.code }}
Vue template
{{ current.template }}
{{ scenario === 'proxy' ? 'Proxy get / set implementation' : 'Show input adapter code' }}
{{ current.adapter }}{{ host.data?.title }}
- {{ item.name }}
{{ scenario === 'proxy' ? 'Commands generated as input arrives' : 'host.data' }}
{{ entry.op }} {{ JSON.stringify(entry.path) }} = {{ JSON.stringify(entry.value) }}
{{ scenario === 'http' ? 'Show byte chunks and decoded text' : scenario === 'sse' ? 'Show SSE messages and JSON fragments' : 'Show input and object' }}
{{ scenario === 'http' ? 'UTF-8 byte chunks (hex)' : 'Simulated SSE messages' }}
{{ wire.join(scenario === 'http' ? '\n' : '') }}String input passed to parse
{{ received }}host.data
{{ error }}
{{ current.note }}
Tests and measurement
Tests & performance
Validate syntax, chunk boundaries, Vue proxies, and the published package.
Compare complete parsing times using the same input and chunks.
Node 24.21.0 · JSON syntax, chunk boundaries, Vue integration, and package installation.Test coverage ↗
Benchmark on your device
4,096-character chunksgradual-json0.1.1
jsonriver1.1.1
@streamparser/json0.0.26 · partial
{{ item.title }}{{ item.bytes ? item.bytes.toLocaleString('en-US') + ' B' : '—' }}
Libraries differ in partial update granularity and parsing semantics. This chart compares complete parsing times for valid input.
Runs in this browser on your device. ASCII JSON, 4,096-character chunks, 3 warmups, and 11 trials with rotating library order; reports the median. Complete results are checked before timing. Excludes library loading, network waits, input decoding, and Vue updates.Measured on this device: {{ measuredAt }}.