-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreaddir.js
More file actions
46 lines (46 loc) · 816 Bytes
/
readdir.js
File metadata and controls
46 lines (46 loc) · 816 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
module.exports = {
name: "readdir",
ns: "fs",
description: "fs readdir",
phrases: {
active: "Listing files from directory {{input.path}}"
},
ports: {
input: {
path: {
type: "string"
}
},
output: {
error: {
title: "Error",
type: "object"
},
files: {
title: "Files",
type: "array"
}
}
},
dependencies: {
npm: {
fs: require('fs')
}
},
fn: function readdir(input, $, output, state, done, cb, on, fs) {
var r = function() {
fs.readdir($.path, function readdirCallback(error, files) {
cb({
error: error,
files: files
});
});
}.call(this);
return {
output: output,
state: state,
on: on,
return: r
};
}
}