Technical Specification
Architecture, type system, and implementation details for JSON Toolbox v2.3.0.
Overview
| Property | Value |
| Version | 2.3.0-final |
| Operators | 65 |
| Namespaces | 12 |
| Bundle Size | 174.3 KB |
| Dependencies | 0 (zero) |
| Runtimes | Node.js, Deno, Bun, Browser |
Type System
Base Types
| Type | Description |
string | UTF-8 string |
number | IEEE 754 double |
boolean | true/false |
null | Null value |
array | JSON array |
object | JSON object |
any | Any JSON value |
Format Types
| Format | Notation |
| CSV | string:csv |
| JSON | string:json |
| XML | string:xml |
| YAML | string:yaml |
| NDJSON | string:ndjson |
Composite Types
| Type | Notation |
| Array of objects | array:object |
| Array of strings | array:string |
| Array of numbers | array:number |
Determinism Guarantees
- Reproducible: Same input + params = identical output (byte-for-byte)
- SHA-256 verified: Outputs can be checksummed across runs
- Cross-runtime: Identical behavior in Node.js, Deno, Bun
- Seeded randomness:
ndjson.sample uses deterministic PRNG
# Verify determinism
echo '{"a":1}' | json-toolbox exec json.format | sha256sum
# Run 1000x - same hash every time
Privacy Model
- Zero network calls: All processing is local
- No telemetry: Analytics are opt-in only
- No persistence: Nothing stored beyond session
- Compliance mode: Zero-network build available
Architecture
Core Components
core/
index.js # Entry point
registry.js # Operator registry (shared browser/CLI)
pipeline.js # Pipeline execution engine
types.js # Type definitions
errors.js # Error types
manifest.js # Manifest parsing/validation
Operator Structure
{
name: 'namespace.operation',
description: 'What it does',
category: 'format|transform|aggregate|streaming|query',
input: { type: 'string', format: 'json' },
output: { type: 'any' },
params: {
paramName: {
type: 'string|number|boolean|array|object',
default: value,
description: 'What it controls'
}
},
tags: ['keyword', 'tags'],
examples: [{ input: '...', params: {...}, output: '...' }],
execute: (input, params) => result
}
CLI Exit Codes
| Code | Meaning |
| 0 | Success |
| 1 | General error |
| 2 | Invalid arguments |
| 10 | Unknown operator |
| 11 | Unknown parameter (strict mode) |
| 20 | Parse error (input) |
| 21 | Transform error |
| 30 | Pipeline manifest error |
Browser/CLI Parity
All 65 operators behave identically in browser and CLI:
- Same operator registry (core/registry.js)
- Same execution engine (core/pipeline.js)
- Same type validation
- 60 parity tests verify identical output
Streaming Mode
CLI supports memory-efficient streaming for large NDJSON files:
json-toolbox exec transform.filter \
--key status --operator eq --value active \
--stream \
--chunk 1000 \
--progress < huge.ndjson
| Flag | Description |
--stream | Enable line-by-line processing |
--chunk N | Process N lines at a time (default 1000) |
--progress | Show progress to stderr |
--verbose | Show execution metrics |