@sketchlog/wasm
v1.2.5
Published
Bounded-memory SketchLog WebAssembly runtime
Maintainers
Readme
@sketchlog/wasm
Bounded-memory SketchLog runtime compiled to WebAssembly.
npm install @sketchlog/wasmconst { StreamLog } = require("@sketchlog/wasm");
await StreamLog.init();
const log = new StreamLog();
log.addBatch([10, 20, 30]);
console.log(log.p99);
log.destroy();Call StreamLog.init() before constructing a log and call destroy() when the
instance is no longer needed. Serialized 64-bit counters are decimal strings so
they remain precise across JavaScript runtimes and can be merged through the
SketchLog server.
Browser bundlers must serve the packaged dist/sketchlog.wasm asset and make
its URL available to the Emscripten loader. See the
WASM documentation
for browser and server-merge examples.
Source development
Docker is the only build prerequisite. From wasm/, run:
npm ci
npm testnpm test builds the runtime with a digest-pinned Emscripten image before
running the Node smoke test, so a clean checkout does not depend on a hidden
prebuilt dist/ directory.
If the pinned image is not already cached, the build retries transient registry
failures three times with bounded backoff and then runs with --pull=never.
