You can use Filehound to do this.
For example: find all .html files in /tmp:
const Filehound = require('filehound');
Filehound.create()
.ext('html')
.paths("/tmp")
.find((err, htmlFiles) => {
if (err) return console.error("handle err", err);
console.log(htmlFiles);
});
For further information (and examples), check out the docs: https://github.com/nspragg/filehound
Disclaimer: I'm the author.