kunstwerk
v0.0.1
Published
Kunstwerk core library
Readme
kunstwerk
Core rendering, playback, recording, and serialization APIs for Kunstwerk sketches.
Install
npm install kunstwerkSerialization
Serialization and deserialization live in the core package:
import {
compressSketch,
deserializeSketch,
deserializeSketchData,
serializeSketch,
} from "kunstwerk";
const json = serializeSketch(sketch);
const fromJson = deserializeSketch(json);
const compressed = await compressSketch(sketch);
const fromCompressedData = await deserializeSketchData(compressed);deserializeSketchData accepts serialized JSON strings, Blob and File objects, ArrayBuffer
objects, and typed-array views. Gzip-compressed exported files are detected and decompressed
automatically. Input structure and file-version compatibility are validated before a sketch is
returned.
