Skip to content

Convert XML to JSON in a nice and consistent format

License

Notifications You must be signed in to change notification settings

ORESoftware/xml.json

Repository files navigation

Oresoftare / XML.js

Stream XML and parse to JavaScript objects

Read from a file, or use a readable stream.

import {XMLParser} from '@oresoftware/xml.js'

fs.createReadStream(file).pipe(new XMLParser()).once('result', function(result){
     // your XML is now a JS object
});

Now if you want to stream chunks of JS objects

fs.createReadStream(file).pipe(new XMLParser({key: 'foobar'})).on('jschunk', function(c){
     // represents a Node instance in your data
});

Just pass in a file path:

The library will create a read stream for you.

new XMLParser({file}).once('result', function(c){
     // c represents a Node instance in your data
});

About

Convert XML to JSON in a nice and consistent format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published