To find files by extension, *.html under a folder in Node.js, we use the glob function.
For instance, we write
const glob = require("glob");
glob(__dirname + "/**/*.html", {}, (err, files) => {
console.log(files);
});
to call glob with the path pattern to search for and a callback that has the files result returned from the search.