-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcsv.js
52 lines (52 loc) · 1018 Bytes
/
csv.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
48
49
50
51
52
module.exports = {
name: "csv",
ns: "utils",
title: "CSV",
async: true,
description: "NodeCSV Parser",
phrases: {
active: "Parsing CSV"
},
ports: {
input: {
"in": {
type: "string",
title: "CSV",
async: true,
description: "A Comma Seperated Values document",
required: true,
fn: function __IN__(data, source, state, input, $, output, csv) {
var r = function() {
csv().
from.
string($.in, {}).
to.
array(function(val) {
output({
out: $.write('in', val)
});
});
}.call(this);
return {
state: state,
return: r
};
}
}
},
output: {
out: {
type: "array",
title: "Output",
description: "An array of records"
}
}
},
dependencies: {
npm: {
csv: require('csv')
}
},
state: {},
on: {}
}