sax-async
Wrapper around sax-js to allow for asynchronous event handlers, and using streams2 to properly exert backpressure on piped streams
Last updated 5 years ago by crispy1989 .
BSD-2-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sax-async 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.4                                ...           latest (5 years ago)

4 Versions

  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 5
Dependencies (3)
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |