Skip to content

Gityosan/greft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

greft

Language-agnostic lossless binary serializer.

JS library (js/)

import { encode, decode } from "greft";

const bytes = encode(value); // value -> Uint8Array (lossless, cycles + shared identity)
const back = decode(bytes); // Uint8Array -> value
  • Extension types — losslessly serialize values the core rejects (class instances, domain types, …) by registering a TypeExtension: encode(v, { types }) / decode(bytes, { types }).
  • Decode hardeningdecode(bytes, { maxNodes }) plus built-in bounds checks reject malformed/oversized input.
  • JSON bridgetoJSON(value) / fromJSON(json) give a JSON.stringify-able view for inspecting or hand-editing fixtures (lossy on identity; rejects cycles).
  • CLIgraft inspect <file.bin> (readable tree + summary) and graft diff <a.bin> <b.bin> (value-graph diff).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors