epp2json

0.9.8 • Public • Published

epp2json

epp <=> json

Install

$ npm install epp2json

Usage

function exception(SyntaxError, e) {
    if(!(e instanceof SyntaxError))
        throw e;
    console.log(e);
}
const xml = require('epp2json/xml');

try {
    var _epp = xml.parse(_xml);
}
catch(e) {
    exception(xml.SyntaxError, e);
}

try {
    var _xml = xml.stringify(_epp);
}
catch(e) {
    exception(xml.SyntaxError, e);
}
const convert = require('epp2json');

try {
    var _json = convert.parse(_epp);
}
catch(e) {
    exception(convert.SyntaxError, e);
}

try {
    var _epp = convert.stringify(_json);
}
catch(e) {
    exception(convert.SyntaxError, e);
}

License

GPL © May xiaoya zhang

Readme

Keywords

Package Sidebar

Install

npm i epp2json

Weekly Downloads

0

Version

0.9.8

License

GPL

Unpacked Size

1.94 MB

Total Files

151

Last publish

Collaborators

  • may