Is it possible to include multiple patterns in a single search string in glob
for Node.js?
For example to find all files named *abc*.pdf
and *xyz.pdf*
When using node-glob you can provide multiple patterns like this:
"*(pattern1|pattern2|...)"
Which would translate in your example like:
"*(abc.pdf|xyz.pdf)"
Full example to find all .html
and .js
files in the current directory:
glob("*(*.js|*.html)", {}, function (err, files) {
console.log(files)
})