Git Product home page Git Product logo

readdirp-walk's Introduction

readdirp-walk

This is a standin replacement for readdirp. See readdirp documentation for API details.

This was written to allow control over the concurrency of scanning to strike a balance between speed and memory.

If you are looking for even more performance and to roll your own scanning algorithm, try fs-iterator which this library uses for scanning.

Aditional Options

  • number: concurrency - option to set the maximum number of concurrent fs operations to strike a balance between speed and memory. (default: based on performance benchmarking).

readdirp-walk's People

Contributors

kmalakoff avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

screenaware

readdirp-walk's Issues

Ignore EACCES errors

I have been using this package, it's been an awesome experience, as it uses a lot less memory than readdirp! Thanks for crafting it!

I have stumbled upon another difference between the two packages. readdirp-walk stops on any error -- in my case, the walker is trying to enter OS X's .Trashes directory, what gives me an EACCES. When using readdirp this error doesn't happen. Here's the log of .on('end', function() { console.log(arguments) }).

{ '0': 
   { [Error: EACCES: permission denied, scandir '/Volumes/Bad Disk/.Trashes']
     errno: -13,
     code: 'EACCES',
     syscall: 'scandir',
     path: '/Volumes/Bad Disk/.Trashes' } }

Finish tests

Take a look at it("TODO", function() {}) and fill them in.

Also, look for other cases to test

How to install and use?

I am currently using readdirp to scan a very large file system and process each of the files found. I have an issue that eventually it just blows up my system as it has too many threads and buffers open.

I can across your modified library readdirp-walk and was hoping this might help me with this issue if I set the concurrency down to 1.
The problem is I can't work out how to install your library. I tried doing a Git Clone and then a node install --production but I still cant work out what I need to do to get your library to replace the existing readdirp library. Can you perhaps put some detailed instructions into the readme file?

many thanks
peter.

Implement global concurrency

There should be a way to bound the maximum number of parallel inflight requests.

function eachArrays(limit) {
  this.limit = limit;
  this.inFlight = 0;
  this.parallelArrays = [];
}

eachArrays.prototype.each(array, fn, callback) { this.arrays.push({array, fn, callback}); }
eachArrays.prototype.end(callback) { /* all done */ }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.