@humanmd/wasm
WASM bindings for the HMD Rust parser, validator, HTML renderer, and patch engine.
Build
Install wasm-pack as a Rust CLI tool instead of an npm dependency:
This keeps the npm package lockfile free of the vulnerable binary-install
dependency chain used by the npm-distributed wasm-pack wrapper.
import init from "@humanmd/wasm";
await ;
const ast = JSON.;
const validation = JSON.;
const html = ;
const patchJson = ;
const patchedFromPatch = ;
const patchedFromIntent = ;
The API returns JSON strings for parsed and validated data so browser and editor integrations do not need to mirror Rust IR types in JavaScript.
Patch APIs do not access the filesystem. They throw on stale targetHash/sourceHash, invalid intent JSON, unsupported actions, and validation failures.