toon-json-parser
v1.0.8
Published
Parser to convert TOON <-> JSON
Maintainers
Readme
📦 TOON JSON Parser
A lightweight and universal transformer to convert between:
🔁 JSON → TOON 🔁 TOON → JSON
Why use it?
✅ Works for any JSON type (objects, arrays, primitives, nested, emojis, special chars) ✅ Dual module support – CommonJS & ESM ✅ Includes TypeScript typings ✅ Clean and safe encoding ✅ Zero dependencies
🧠 TOON Format = JSON where
"is encoded asTOONSimple, reversible, and safe.
📦 Installation
npm install toon-json-parser🚀 Usage Overview
Convert JSON to TOON or TOON back to JSON using two simple functions:
- jsonToToon(value) → returns TOON string
- toonToJson(toonString) → returns JSON value
Works with:
- Objects
- Arrays
- Strings
- Numbers
- Booleans
- Null
- Deep nested structures
- Unicode & emojis
🧩 Example (Universal Encoding)
Input JSON (for understanding)
{
"name": "Alice",
"age": 25,
"emoji": "😀",
"active": true
}Encoded TOON output (concept only)
TOONnameTOON:TOONAliceTOON,TOONageTOON:TOON25TOON,TOONemojiTOON:TOON😀TOON,TOONactiveTOON:TOONtrueTOONDecoding this returns the exact same JSON.
📘 API Reference
jsonToToon(value: any): string
Encodes any valid JSON value into TOON format.
toonToJson(toonString: string): any
Decodes a TOON formatted string back into JSON.
✔ Feature Support
| Feature | Supported | | --------------------------- | :-------: | | Any valid JSON value | ✅ | | Deep nesting | ✅ | | Emojis / Unicode | ✅ | | Arrays, objects, primitives | ✅ | | CommonJS, ESM, TS typings | ✅ | | Reversible transformation | ✅ |
📝 License
MIT License
Copyright (c) 2025 Mohd Asif👤 Author
Mohd Asif MIT License Copyright (c) 2025
