@rea-jet/rea-xml2js

3.1.0 • Public • Published

rea-xml2js

install

npm install git+ssh://git@rj-git.rea.de/web/web-modules/rea-xml2js.git

usage

var xml2js = require('rea-xml2js')();

// xml to json
var xml = '<some a="1">2</some>';
xml2js.toJSON(xml).then(function(result) {
  console.log(result.some._.a, result.some._$); // output: 1 2
});

// json to xml
var json = {
  some: {
    _: { a: '1' },
    _$: '2'
  }
};
xml2js.toXML(json).then(function(result) {
  console.log(result);
  // output:
  // <?xml .. ?>
  // <some a="2">1</some>
});

tests

git clone ssh://git@rj-git.rea.de/web/web-modules/rea-xml2js.git
cd rea-xml2js
npm install
npm test

Readme

Keywords

none

Package Sidebar

Install

npm i @rea-jet/rea-xml2js

Weekly Downloads

16

Version

3.1.0

License

CLOSED SOURCE

Unpacked Size

15.9 kB

Total Files

11

Last publish

Collaborators

  • reajet
  • ds82
  • danielschuech
  • reajet-buildbot