Skip to content

Instantly share code, notes, and snippets.

@antondevv
Created April 10, 2022 13:51
Show Gist options
  • Save antondevv/b906ae9f9cd6a39e040f85edd852daf6 to your computer and use it in GitHub Desktop.
Save antondevv/b906ae9f9cd6a39e040f85edd852daf6 to your computer and use it in GitHub Desktop.
recursive
let files = [];
function fromDir(pathName) {
const entries = getEntries(pathName);
entries.forEach((entry) => {
const entryPath = `${pathName}/${entry}`;
const typeOfEntry = getTypeOfEntry(entryPath);
if (typeOfEntry.isDirectory()) {
fromDir(entryPath);
} else {
files.push(entryPath);
}
});
}
fromDir("src");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment