看起来
globnpm软件包会为您提供帮助。这是一个如何使用它的示例:
文件层次结构:
test├── one.html└── test-nested └── two.html
JS代码:
var getDirectories = function (src, callback) { glob(src + '*', callback);};getDirectories('test', function (err, res) { if (err) { console.log('Error', err); } else { console.log(res); }});显示:
[ 'test/one.html', 'test/test-nested', 'test/test-nested/two.html' ]



