co-xml2js

1.0.0 • Public • Published

co-node-xml2js

node-xml2js with co

Usage

install from npm

npm install co-xml2js
import xml2js from "xml2js";
import co from "co";
 
co(function *() {
 
    var xml = new xml2js.Builder().buildObject({
        xml: {
            div: "text"
        }
    });
 
    var json;
 
    // parse xml
    json = yield xml2js.parseString(xml);
    // or
    var parser = new xml2js.Parser(/*your options*/);
    json = yield parser.parseString(xml);
 
});
 

Package Sidebar

Install

npm i co-xml2js

Weekly Downloads

6

Version

1.0.0

License

MIT

Last publish

Collaborators

  • lext