Created
July 26, 2021 09:57
-
-
Save miyaoka/32588131da0264e3699a4fa2e2c5f9d6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getFilePathList = (dir: string): string[] => { | |
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => { | |
const path = `${dir}/${entry.name}` | |
return entry.isDirectory() ? getFilePathList(path) : path | |
}) | |
} | |
const files = getFilePathList(targetPath) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment