find
Find files or directories by name.
Installation
$ npm install --save find
Examples
Find all files in current directory.
var find = ; find
Filter by regular expression.
find
Features
- Recursively search each sub-directories
- Asynchronously or synchronously
- Filtering by regular expression or string comparing
Changelog
0.3.0
- Added
.use()
method
0.2.0
- The first
pattern
option is now optional - Will follow symbolic links
API
.file([pattern,] root, callback)
find
.dir([pattern,] root, callback)
finddir__dirname { //}
.eachfile([pattern,] root, action)
find
.eachdir([pattern,] root, action)
find
.fileSync([pattern,] root)
var files = find;
.dirSync([pattern,] root)
var dirs = find;
.error([callback])
Handling errors in asynchronous interfaces
find
.end([callback])
Detect end
in find.eachfile
and find.eachdir
find
.use(Options)
fs
: The internal fs object to be used.
const fs vol = ; const json = './README.md': '1' './src/index.js': '2'; vol; find ;