-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxml2js.js
47 lines (47 loc) · 874 Bytes
/
xml2js.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
module.exports = {
name: "xml2js",
ns: "utils",
description: "Simple XML to JavaScript object converter",
phrases: {
active: "Converting XML to Object"
},
ports: {
input: {
xml: {
type: "string",
format: "xml",
title: "XML"
}
},
output: {
error: {
type: "object",
title: "Error Object"
},
result: {
type: "object"
}
}
},
dependencies: {
npm: {
xml2js: require('xml2js')
}
},
fn: function xml2js(input, $, output, state, done, cb, on, xml2js) {
var r = function() {
xml2js.xml2js($.xml, function xml2jsCallback(error, result) {
cb({
error: error,
result: result
});
});
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}