Reads directory and tolerating possible
EBUSY
,EPERM
,EACCES
errors
npm i promise-walker --save
const walk = require('promise-walker');
walk('./path').then(function(items) {
// items -> [
// ...
// {
// path: './path/foo'
// stat: fs.Stat | null,
// error: null | Error('EBUSY') | Error('EPERM') | Error('EACCES')
// }
// ...
// ];
});
walk(path, [options]); // -> Promise
options
:
- concurrency:
Number
: Default: 16. Limits concurrently inspected files;
MIT © Yury Solovyov