List contents of a directory on the local filesystem.
var Filesystem = require('machinepack-fs');
// List contents of a directory on the local filesystem.
Filesystem.ls({
dir: '/Users/mikermcneil/.tmp/foo',
depth: 1,
includeFiles: true,
includeDirs: true,
includeSymlinks: true,
includeHidden: false,
}).exec({
// An unexpected error occurred.
error: function (err) {
},
// No directory was found at the specified directory path.
doesNotExist: function () {
},
// OK.
success: function (result) {
},
});
Path to the directory whose contents should be listed.
'/Users/mikermcneil/.tmp/foo'
The maximum number of "hops" (i.e. directories deep) to include directory contents from.
1
Whether or not to include files.
true
Whether or not to include directories.
true
Whether or not to include symbolic links.
true
Whether or not to include hidden files/directories/symlinks.
false
An unexpected error occurred.
No directory was found at the specified directory path.
OK.
[ '/Users/mikermcneil/.tmp/foo/.gitignore' ]