jeromew / sax-stream

Transform stream implemented using SAX parser

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build Status Dependency Status NPM version

sax-stream

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

Installation

  $ npm install sax-stream

Usage

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

API

Create passing options object.

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

TODO

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

License

MIT

About

Transform stream implemented using SAX parser

License:MIT License


Languages

Language:JavaScript 97.9%Language:Makefile 2.1%