Introducing TOON β Typed Object Oriented Notation
JSON is everywhere.
It powers APIs, microservices, automation tools, and frontend apps.
But as applications scale, JSON becomes:
verbose
repetitive
bandwidth heavy
lacking type structure
Thatβs why I built TOON (Typed Object Oriented Notation) β a compact, typed, and developer-friendly alternative.
π npm: https://www.npmjs.com/package/toonkit
π§ What is TOON?
TOON = Typed Object Oriented Notation
It combines:
β schema
β data
β types
β compact structure
Think of it as JSON + schema + compression + readability.
β The Problem with JSON
A typical API response:
{
"employees": [
{ "id": 1, "name": "Riya", "salary": 90000, "active": true },
{ "id": 2, "name": "John", "salary": 80000, "active": false }
]
}
Problems:
repeated keys increase payload size
no built-in typing
inefficient for large responses
β
The TOON Solution
employees[2]{id:n,name:s,salary:n,active:b}:
1,Riya,90000,true
2,John,80000,false
β smaller payload
β typed schema
β readable structure
β faster parsing
π Parsed Output
[
{ id: 1, name: "Riya", salary: 90000, active: true },
{ id: 2, name: "John", salary: 80000, active: false }
]
𧬠Supported Data Types
Code Type
n number
s string
b boolean
nl null
j JSON object
a array
β‘ Why Developers Like TOON
β
Smaller Payload Size
Less bandwidth, faster APIs.
β Built-in Type Safety
Schema ensures consistent data.
β Multi-Resource Responses
Return multiple datasets in one response.
β Human Readable
Debug easily without extra tools.
β Frontend β Backend Symmetry
Same format everywhere.
π¦ Install
npm install toonkit
π§© Example Usage
Convert JSON β TOON
import { sendToon } from "toonkit";
const payload = sendToon({
employees: [{ id: 1, name: "Riya" }]
});
Convert TOON β JSON
import { receiveToon } from "toonkit";
const data = receiveToon(text);
π₯ Express Example
const express = require("express");
const { reqGetToon, resSendToon } = require("toonkit");
const app = express();
app.use(express.text());
app.post("/api", (req, res) => {
const data = reqGetToon(req);
resSendToon(res, data);
});
π§ When TOON is Useful
β
APIs returning multiple resources
β
automation & bots
β
low bandwidth environments
β
Chrome extensions
β
microservices
β
real-time systems
π Documentation
Full docs & playground:
π https://toonkit.manojgowda.in
π» GitHub
https://github.com/ManojGowda89/toonkit
π¬ Why I Built TOON
I wanted a data format that:
reduces payload size
simplifies API responses
provides typing without complexity
works seamlessly in JavaScript
TOON is my attempt to make data exchange simpler and more efficient.
π Try TOON Today
π https://www.npmjs.com/package/toonkit
If you find it useful, Iβd love your feedback and contributions.

Top comments (1)
have you ever heard about Protocol Buffers by Google? (Protobuf)