paths-resolve
A simple function with no extra dependencies to recursively walk through a directory and sub-directories. It returns an array of absolute paths to files.
Useful for bootstrapping.
npm install --save paths-resolve
Usage:
const pathsResolve = ; let files = ; console;
output something like:
'/var/projects/my-project/file.js' '/var/projects/my-project/my-subdir/file.json' '/var/projects/my-project/my-subdir/file.js'
Options:
extensions: []
allowed extensions (.js, .json, .whatever, ...)
exclude: []
exclude files (index.js, something.json, etc...)
onFound: (absolutePath) => absolutePath
act on value before it is pushed and returned. Always return or you'll get undefined.