0.0.4 • Published 9 years ago

sax-async v0.0.4

Weekly downloads
7
License
BSD-2-Clause
Repository
-
Last release
9 years ago

Version of sax-js which uses the new streams API for backpressure, and allows callbacks on the events using crisphooks.

var SaxAsync = require('sax-async');

var strict = false;
var options = {};

var parseStream = new SaxAsync(strict, options);

parseStream.hookAsync('closetag', function(next, tag) {
	console.log(tag);
	setTimeout(next, 100);
});

parseStream.hookSync('end', function() {
	console.log('Ended.');
});

require('fs').createReadStream('./test.xml').pipe(parseStream);