I\'d like to find all *.html files in src folder and all its sub folders using nodejs. What is the best way to do it?
var folder = \'/project1/src\';
var ex
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.