npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

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

Keywords

install

npm i sax-async

Downloadsweekly downloads

10

version

0.0.4

license

BSD-2-Clause

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability