Social Media Photo by Agenlaku Indonesia on Unsplash
16 years ago I wrote json.hpack for PHP, JS and C#
14 years ago I re-wrote JSONH for Python, PHP and JS.
A few days ago TOON non-standard format came out.
packatoon module allows anyone to "pack" and "unpack" homogenous collections which is pretty much what any .csv file has done since about forever, except it remains JSON compatible like all previous work did before TOON came out.
As summary, this module simply uses modern JS to accomplish what TOON or JSONH before did without pretending to be, or do, anything else.
example
import { pack, unpack } from 'packatoon';
const collection = [
{ a: 1, b: 2 },
{ a: 3, b: 4 },
];
const packed = pack(collection);
// [2, 'a', 'b', 1, 2, 3, 4]
unpack(packed);
// [{a:1,b:2},{a:3,b:4}]That's it.