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 → Express plugin
🧩

Express plugin

Register middleware for Express

Express users can mount the `toon` middleware from `toonkit2/express` to get `req.toon()` and `res.toon()` helpers.

Express Plugin
import express from "express";
import { toon } from "toonkit2/express";

const app = express();
// Mount middleware (returns [parser, responder] or a single middleware depending on build)
app.use(...toon());

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