xml-element-stream
Fast xml stream parser for large xml files, based on saxjs, in javascript only
Last updated 3 years ago by mhzed .
ISC · Original npm · Tarball · package.json
$ cnpm install xml-element-stream 
SYNC missed versions from official npm registry.

xml-element-stream

A wrapper around saxjs to parse large xml file in stream mode:

  1. Javascript only
  2. Very fast in nodejs

Usage

  import {Element, ElementStream} from "xml-element-stream";
  import * as fs from 'fs';
  import * as path from 'path';

  let wikistream = ElementStream.create({});
  // Spit out page element when </page> is encountered
  wikistream.registerTag("page");

  fs.createReadStream(path.join(__dirname, "test.wikidump.xml"))
      .pipe(wikistream)
      .on('data', (e: Element)=>{
        console.log(e.tag.name);    // all "page"
        e.children;   // array of children embeded in page element
      })
      .on('end', ()=>{
        // stream finished  
      })

Current Tags

  • 0.0.5                                ...           latest (3 years ago)

5 Versions

  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 3
Last Month 12
Dependencies (2)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |