YurySolovyov / promise-walker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

promise-walker

Codeship CI status Deps license:mit

Reads directory tolerating possible EBUSY, EPERM, EACCES errors

Install

npm i promise-walker --save

Example

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')
  //   }
  //   ...
  // ];
});

API

walk(path, [options]); // -> Promise

options:

  • concurrency: Number: Default: 16. Limits concurrently inspected files;

License

MIT © Yury Solovyov

About

License:MIT License


Languages

Language:JavaScript 100.0%