0.2.0 • Published 9 years ago
readdirr v0.2.0
readdirr
Recursive fs.readdir.
readdirr(root, filterFn)
root: string- The root directory to scan.filterFn: string -> boolean- File name filtering function. By default it skips dot files and node_modules.returns
Promise<[string]>- File paths relative toroot
If root is already a file then a single empty string will be returned
Example
const readdirr = require('readdirr')
readdirr('node_modules/some-module').then(files => {
for (const file of files) console.log(file)
})
// package.json
// README.md
// lib/index.jsTODO
- Sync version
- Tests