1.1.2 • Published 9 years ago

@yr/readdir v1.1.2

Weekly downloads
37
License
MIT
Repository
github
Last release
9 years ago

Readdir utility, with recursive option and filtering

Usage

var readDir = require('readdir')
  , path = '/test/'
  , dir = readDir(path, true, /\.json$/);

console.log(dir); //=> ['foo.json', 'bar.json', ...]

API

readdir(dir, recursive, filter): Gather all files in 'dir', optionally recursively and filtered by 'filter' regex

readdir('/test', false); //=> Returns array with files in /test directory
readdir('/test/', true); //=> Returns array with files in /test dir and sub-directories.
readdir('/test/', true, /\.json$/); //=> Returns array with all json files found in /test directory and sub-directories