0.2.0 • Published 7 years ago

readdirr v0.2.0

Weekly downloads
3
License
ISC
Repository
-
Last release
7 years ago

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 to root

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.js

TODO

  • Sync version
  • Tests