I search a module to find files in nodejs.
I would like something like:
var finder = require('finder');
var path = finder.find('/path/to/*.js');
Then path is an array with for example:
/path/to/file.js
/path/to/sub/file.js
...
In addition to @pksunkara answer:
For simple searches supporting callbacks you can use: https://github.com/yuanchuan/find
Alternatively, you can use filehound
which supports async (callbacks, promises) and sync calls. In addition, you can specify multiple search criteria like file extension, size etc
Example:
const Filehound = require('filehound');
const files = Filehound.create()
.ext('js')
.findSync();
console.log(files) // json files
Repo: https://github.com/nspragg/filehound
API docs: https://nspragg.github.io/filehound/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With