Skip to content

Instantly share code, notes, and snippets.

@slayerlab
Last active August 29, 2018 15:11
Show Gist options
  • Save slayerlab/4b6ec7bbec432bd0bf6cfeba5ccd2ec3 to your computer and use it in GitHub Desktop.
Save slayerlab/4b6ec7bbec432bd0bf6cfeba5ccd2ec3 to your computer and use it in GitHub Desktop.
só pra mim não esquecer
const xmlStream = require('xml-stream')
, fs = require('fs')
var stream = fs.createReadStream(__dirname+'./filename.xml')
, xml = new xmlStream(stream)
xml.preserve('some_subnode', true)
xml.collect('subtime_from_some_subnode')
xml.on('endElement: item', function (node) {
console.log(node)
})
@slayerlab
Copy link
Author

I hate that appearance, albeit this code-style is useful so plenty at diff'ing moments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment