-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquery.js
More file actions
49 lines (49 loc) · 950 Bytes
/
query.js
File metadata and controls
49 lines (49 loc) · 950 Bytes
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
48
49
module.exports = {
name: "query",
ns: "json",
title: "JSON Query",
description: "Retrieves values from JSON objects",
async: true,
phrases: {
active: "Querying JSON"
},
ports: {
input: {
"in": {
type: "object",
title: "JSON",
required: true,
fn: function __IN__(data, source, state, input, $, output, json_query) {
var r = function() {
output({
out: $.write('in', json_query($.query, {
data: $.in
}).value)
});
}.call(this);
return {
state: state,
return: r
};
}
},
query: {
type: "string",
title: "Query"
}
},
output: {
out: {
type: "object",
title: "Object"
}
}
},
dependencies: {
npm: {
"json-query": require('json-query')
}
},
state: {},
on: {}
}