Files
xml-streamer/examples/parse.ts
2019-07-05 00:23:29 +03:00

12 lines
306 B
TypeScript

// By passing a string or buffer to parse function
import { XmlParser } from "../";
const opts = { resourcePath: "/items/item" }; // resourcePath is manditory when using parse method
const parser = new XmlParser(opts);
parser.parse(stringOrBuffer, (err, data) => {
// consume data here
});