Can anyone please suggest how to add multiple file extensions with the glob.sync
method.
Something like:
const glob = require('glob');
let files = glob.sync(path + '**/*.(html|xhtml)');
Thank you :)
You can use this (which most shells support as well):
glob.sync(path + '**/*.{html,xhtml}')
Or one of these:
glob.sync(path + '**/*.+(html|xhtml)')
glob.sync(path + '**/*.@(html|xhtml)')
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