toonkit2
Type-SafeCompactHuman-ReadableMIT

toonkit2

A parser & serializer for TOON — Typed Object Oriented Notation. Transform JSON to compact TOON format and back with built-in type awareness.

$ npm install toonkit2
Docs → What is toonkit2?
📦

What is toonkit2?

Why TOON? Why this library?

toonkit2 provides the official major-update core parser/serializer and framework adapters for easy integration with HTTP clients and servers.

  • toonToJson(input: string) — Parses TOON text into JavaScript objects
  • jsonToToon(obj: any) — Serializes JavaScript objects to TOON format
  • Adapter exports — `toonkit2/express`, `toonkit2/fastify`, `toonkit2/hono`, `toonkit2/next/server`, and a `toonkit2/fetch` client for convenience.

Why TOON?

JSON is powerful but verbose. TOON solves this by separating the schema definition from the data rows — like a typed table format. Result: smaller payloads, faster parsing, and type safety built in.

📉
40-60% smaller
No repeated key names
🔤
Human-readable
Plain text, easy to edit
🏷️
Type-safe
Schema declares all types
⚡
Fast parsing
Minimal overhead structure