Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

leonatherton/xml2js-es6-promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

Use xml2js.parseStringPromise(data /*, options */) from the xml2js package instead.

xml2js-es6-promise

ES6 promise wrapper for xml2js

Installation

npm install xml2js-es6-promise

Usage

var xml2js = require('xml2js-es6-promise');

xml2js(xml).then(function(js) {
  console.log(JSON.stringify(js));
});

xml2js(xml, options).then(function(js) {
  console.log(JSON.stringify(js));
});

// e.g.
xml2js("<root>Hello xml2js!</root>", {trim: true}).then(function(js) {
  console.log(JSON.stringify(js));
});