readdirr

0.2.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i readdirr

Weekly Downloads

2

Version

0.2.0

License

ISC

Last publish

Collaborators

  • phaux