diff --git a/lib/api.js b/lib/api.js index 31853a5..bd474c3 100644 --- a/lib/api.js +++ b/lib/api.js @@ -2,7 +2,7 @@ var uuid = require('uuid'); var url = require('url'); var request = require('request'); var Q = require('q'); -var xml2js = require('xml2js'); +var xml2json = require('xml2json'); var uri = require('./uri'); var auth = require('./auth'); @@ -122,7 +122,7 @@ PlexAPI.prototype._request = function _request(relativeUrl, method, parseRespons return deferred.resolve(JSON.parse(body.toString('utf8'))); } if (response.headers['content-type'].indexOf('xml') > -1) { - return deferred.resolve(xml2js.parseString(body.toString('utf8'), { + return deferred.resolve(xml2json.toJson(body.toString('utf8'), { object: true })); } diff --git a/package.json b/package.json index 9f61707..f7ad4b1 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "q": "^1.0.1", "request": "^2.36.0", "uuid": "^2.0.1", - "xml2js": "^0.4.9" + "xml2json": "^0.6.2" }, "devDependencies": { "expect.js": "*",