mirror of
https://github.com/danbulant/console-hub
synced 2026-05-20 04:48:54 +00:00
15 lines
396 B
JavaScript
15 lines
396 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();
|
|
isDirectory ?
|
|
walkDir(dirPath, callback) : callback(path.join(dir, f));
|
|
});
|
|
}
|
|
}
|