@hpcc-js/wasm-expat
v1.9.0
Published
hpcc-js - WASM expat
Maintainers
Readme
@hpcc-js/wasm-expat
This package provides a WebAssembly wrapper around the libexpat library. This provides efficent SAX XML parsing.
Installation
npm install @hpcc-js/wasm-expatUsage
import { Expat } from "@hpcc-js/wasm-expat";
const expat = await Expat.load();
const xml = ` \
<root>
<child xxx="yyy">content</child>
</root>
`;
const callback = {
startElement(tag, attrs) { console.log("start", tag, attrs); },
endElement(tag) { console.log("end", tag); },
characterData(content) { console.log("characterData", content); }
};
expat.parse(xml, callback);