Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能建议如何使用该glob.sync方法添加多个文件扩展名。
glob.sync
就像是:
const glob = require('glob'); let files = glob.sync(path + '**/*.(html|xhtml)');
谢谢 :)
您可以使用它(大多数 shell 也支持):
glob.sync(path + '**/*.{html,xhtml}')
或其中之一:
glob.sync(path + '**/*.+(html|xhtml)') glob.sync(path + '**/*.@(html|xhtml)')