globby icon indicating copy to clipboard operation
globby copied to clipboard

Allow abort glob progress

Open otakustay opened this issue 7 months ago • 1 comments

I was racing a globby call with a 200ms timeout so that I can fallback to a default value if glob takes too long, I’d also like to abort glob progress if timeout happens to save some filesystem scan and cpu usage, how about if we can pass an AbortSignal in oprions?

Another case is to implement something like globExists which returns true on first match, this is done by using globStream function and directly return true in the for … await loop, also I’d like to abort further progress of glob

Of course it’s a best if a globExists function can be provided.

otakustay avatar Jan 09 '24 14:01 otakustay

Makes sense, but it will have to be implemented in https://github.com/mrmlnc/fast-glob first. Open an issue there too.

sindresorhus avatar Jan 09 '24 17:01 sindresorhus