sax-stream
Transform stream implemented using SAX parser
Last updated 2 years ago by pirxpilot .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install sax-stream 
SYNC missed versions from official npm registry.

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 downstream to another transform/writeable stream or handle data event.

var saxStream = require('sax-stream');


request('http://blog.npmjs.org/rss')
  .pipe(saxStream({
  	strict: true,
    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, an Array of tag names can be used - when multiple tags are specified stream pushes { tag, record } tuples
  • highWaterMark - size of internal transform stream buffer - defaults to 350 objects
  • strict - default to false, if true makes sax parser to accept valid XML only
  • trim, normalize, lowercase, xmlns, position, strictEntities, noscript - passed to sax parser

License

MIT

Current Tags

  • 1.3.0                                ...           latest (2 years ago)

8 Versions

  • 1.3.0                                ...           2 years ago
  • 1.2.3                                ...           3 years ago
  • 1.2.2                                ...           4 years ago
  • 1.2.1                                ...           4 years ago
  • 1.2.0                                ...           4 years ago
  • 1.1.0                                ...           4 years ago
  • 1.0.0                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (2)
Downloads
Today 3
This Week 3
This Month 3
Last Day 0
Last Week 6
Last Month 19
Dependencies (2)
Dev Dependencies (3)

Copyright 2014 - 2017 © taobao.org |