xml-objects

Streaming wrapper around xml2js

xml-objects

Streaming wrapper around xml2js

Pipe fully formed bits of xml to xml-objects to parse into javascript objects. Works great with xml-nodes.

With npm do:

npm install xml-objects
var request = require('request');
var xmlNodes = require('xml-nodes');
var xmlObjects = require('xml-objects');
 
request('http://news.yahoo.com/rss/entertainment')
  .pipe(xmlNodes('item'))
  .pipe(xmlObjects({explicitRoot: false, explicitArray: false, mergeAttrs: true}))
  .on('data', function(data) {
    console.log(data.title);
  });

MIT