@ttoon/shared
v0.1.0
Published
TTOON typed serialization format — JavaScript/TypeScript implementation
Downloads
10
Maintainers
Readme
@ttoon/shared
@ttoon/shared is the core JavaScript and TypeScript package for TTOON.
Call await initWasm() once before using the parsing and serialization APIs.
Features
parse()/stringify()toTjson()readArrow()/stringifyArrow()detectFormat()use()for codec registration
Installation
npm install @ttoon/sharedInstall apache-arrow to enable Arrow APIs:
npm install @ttoon/shared apache-arrowQuick Example
import { initWasm, parse, stringify, toon, toTjson } from '@ttoon/shared';
await initWasm();
const text = stringify({ name: 'Alice', score: 95 });
const data = parse(text);
const typedJson = toTjson({
id: toon.uuid('550e8400-e29b-41d4-a716-446655440000'),
});See docs/public/en/ for guides and API reference material.