lemox
Simple wrapper of sax.js based on stream2
Last updated 7 years ago by burkostya .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lemox 
SYNC missed versions from official npm registry.

lemox

Simple wrapper of sax.js, based on stream2, created for one purpose only - parsing huge files and extracting nodes with specified name.

Instalation

npm install lemox

Example

var fs       = require('fs');
var Writable = require('stream').Writable;

var Lemox = require('./lib/lemox');

var parser = new Lemox({ selector: 'House' });

var file = fs.createReadStream('/path/to/huge/xml/file');

var slowStream = new Writable({ objectMode: true });
slowStream._write = function (obj, enc, done) {
  console.log(obj);
  setTimeout(function () {
    done();
  }, 300);
};

file
  .pipe(parser)
  .pipe(slowStream);

Tests

npm test

License

Copyright (c) 2013 Konstantin Burykin
Licensed under the MIT license.

Current Tags

  • 0.0.3                                ...           latest (7 years ago)

2 Versions

  • 0.0.3                                ...           7 years ago
  • 0.0.2                                ...           7 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |