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 :)
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 :)
Copyright © 2021 Jogjafile Inc.
You can use this (which most shells support as well):
Or this one:
EDIT: I initially also suggested this pattern:
However, this will also match files that have
.htmlhtmlas extension (plus any other combination ofhtmlandxhtml, in single or multiple occurrences), which is incorrect.