sax-stream

Transform stream implemented using SAX parser

sax-stream

Transform stream for parsing large XML files. It is using SAX module internally. Emits objects: one object per each selected node.

  $ npm install sax-stream

Use as any transform stream: pipe request or file stream to it, pipe it to downstream another transform stream or writeable handle data event.

var saxStream = require('sax-stream');
 
 
request('http://blog.npmjs.org/rss')
  .pipe(saxStream({
    tag: 'item'
  })
  .on('data', function(item) {
    console.log(item);
  });
 

Create passing options object.

tag - name of the tag to select objects from XML file

  • pass more options to Transform stream and to sax parser (currently highWaterMark is hard coded at 350)

License

MIT