Socket
Socket
Sign inDemoInstall

sax-stream

Package Overview
Dependencies
3
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sax-stream

Transform stream implemented using SAX parser


Version published
Weekly downloads
3.9K
increased by11.28%
Maintainers
2
Install size
121 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 15 Nov 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc