hedl-wasm
WebAssembly bindings for HEDL, enabling use in browsers and Node.js.
Installation
Usage (JavaScript/TypeScript)
import init, { parse, toJson, fromJson } from 'hedl-wasm';
await init();
// Parse HEDL
const doc = parse(`
%VERSION: 1.0
---
name: Example
value: 42
`);
// Convert to JSON
const json = toJson(doc);
console.log(json);
// Parse from JSON
const doc2 = fromJson('{"name": "Example", "value": 42}');
Browser Usage
Available Functions
parse(hedl: string)- Parse HEDL stringtoJson(doc)- Convert to JSONfromJson(json: string)- Parse JSON to HEDLvalidate(hedl: string)- Validate HEDL syntaxformat(hedl: string)- Canonicalize HEDLlint(hedl: string)- Lint HEDL document
Building from Source
License
Apache-2.0