sax-async

0.0.4 • Public • Published

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);

Dependents (1)

Package Sidebar

Install

npm i sax-async

Weekly Downloads

4

Version

0.0.4

License

BSD-2-Clause

Last publish

Collaborators

  • crispy1989
  • giuocob