@dappnode/dappnodesdk
Version:
dappnodesdk is a tool to make the creation of new dappnode packages as simple as possible. It helps to initialize and publish in ethereum blockchain
21 lines • 567 B
JavaScript
import fs from "fs";
import path from "path";
/**
* Util that returns all files recursively in a given path
* @param dir "docs"
* @return ["docs/about.html", "docs/index.html"]
*/
export function traverseDir(dir) {
if (fs.lstatSync(dir).isDirectory()) {
const filePaths = [];
fs.readdirSync(dir).forEach(file => {
const fullPath = path.join(dir, file);
filePaths.push(...traverseDir(fullPath));
});
return filePaths;
}
else {
return [dir];
}
}
//# sourceMappingURL=traverseDir.js.map