node.js glob pattern for excluding multiple files

后端 未结 6 1249
情话喂你
情话喂你 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:47

    You can use node-globule for that:

    var globule = require('globule');
    var result = globule.find(['**/*', '!index.html', '!js/lib.js']);
    console.log(result);
    

提交回复
热议问题