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 → Fastify Integration
🚀

Fastify Integration

Register plugin for request/response handling

Fastify users can register the `toon` plugin to parse TOON bodies and send TOON responses.

Fastify Plugin
import Fastify from "fastify";
import { toon } from "toonkit2/fastify";

const app = Fastify();
await app.register(toon);

app.post("/devices", async (req, reply) => {
  const data = req.toon();
  reply.toon({ ok: true, received: data });
});