Technical Specification

Architecture, type system, and implementation details for JSON Toolbox v2.3.0.

Overview

PropertyValue
Version2.3.0-final
Operators65
Namespaces12
Bundle Size174.3 KB
Dependencies0 (zero)
RuntimesNode.js, Deno, Bun, Browser

Type System

Base Types

TypeDescription
stringUTF-8 string
numberIEEE 754 double
booleantrue/false
nullNull value
arrayJSON array
objectJSON object
anyAny JSON value

Format Types

FormatNotation
CSVstring:csv
JSONstring:json
XMLstring:xml
YAMLstring:yaml
NDJSONstring:ndjson

Composite Types

TypeNotation
Array of objectsarray:object
Array of stringsarray:string
Array of numbersarray:number

Determinism Guarantees

# Verify determinism
echo '{"a":1}' | json-toolbox exec json.format | sha256sum
# Run 1000x - same hash every time

Privacy Model

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

CodeMeaning
0Success
1General error
2Invalid arguments
10Unknown operator
11Unknown parameter (strict mode)
20Parse error (input)
21Transform error
30Pipeline manifest error

Browser/CLI Parity

All 65 operators behave identically in browser and CLI:

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
FlagDescription
--streamEnable line-by-line processing
--chunk NProcess N lines at a time (default 1000)
--progressShow progress to stderr
--verboseShow execution metrics