node.js glob pattern for excluding multiple files

后端 未结 6 1251
情话喂你
情话喂你 2020-12-24 10:56

I\'m using the npm module node-glob.

This snippet returns recursively all files in the current working directory.

var glob = require(\'glob\');
glob(         


        
6条回答
  •  情书的邮戳
    2020-12-24 11:31

    Check out globby, which is pretty much glob with support for multiple patterns and a Promise API:

    const globby = require('globby');
    
    globby(['**/*', '!index.html', '!js/lib.js']).then(paths => {
        console.log(paths);
    });
    

提交回复
热议问题