const request = require("request");
const xtreamer = require("xtreamer");
const node = "course";
const url = "https://raw.githubusercontent.com/manojc/xtagger/gh-pages/demo/1mb.xml";
let count = 0;
const xtreamerTransform = xtreamer(node)
.on("data", (xmlNode) => ++count % 1000 || console.log(count))
.on("end", () => { console.log(`Nodes processed - ${count}`) })
.on("error", (error) => console.error(error));
request.get(url).pipe(xtreamerTransform);