console-hub/files.js
2019-06-23 12:40:18 +02:00

14 lines
353 B
JavaScript

// files.js
var fs = require('fs');
var path = require('path');
module.exports = {
fs: require('fs'),
path: require('path'),
walkDir: function(dir, callback){
fs.readdirSync(dir).forEach( f => {
let dirPath = path.join(dir, f);
let isDirectory = fs.statSync(dirPath).isDirectory();
callback(path.join(dir, f));
});
}
}