Simple file tree data structure coded for NodeJS
Installing with npm
npm i --save @enigmaoffline/node-file-tree
Importing
const FTree = require("github-fetch");
const ft = new FTree('./src');
ft.setIgnoreNodeModules(false);
ft.printTree();
ft.travel(
(node, layer) => {
// do something when file is reached
},
(node, layer) => {
// do something when directory is reached
}
);