简体   繁体   中英

ignore specific file when using glob to get folder files

我正在使用glob获取我的node js应用程序中的所有文件夹内容,我希望它忽略一个文件,有没有一种优雅的方式来访问它?

 glob("folder/*.js", function (err, extensions) {

The 2nd argument is options , which you can set to ignore a path. Reference

glob("folder/*.js", {ignore: ['folder/dont_want.js']}, function (err, extensions) {

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM