fs-of-type
wraps
async.filter
to find items of a particular type in a directory
Install
npm install --save fs-of-type
Usage
const ofType = ;const pathToContents = path;
API
ofType(pathToContents, [type ...], callback)
Arguments:
pathToContents
- a path (relative to your user home) which contains the items you wish to filter.type
- a string (or array of strings) representing the item type(s) you wish to filter by. The values oftype
must correspond to the names found in the fs.Stats object. (file
,directory
,blockDevice
,symbolicLink
, etc.)callback(err, results)
- a function to be invoked when the filtering has completed.results
is an array of the items of typetype
.
License
MIT © Kevin Donahue