Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow abort glob progress #261

Open
otakustay opened this issue Jan 9, 2024 · 1 comment
Open

Allow abort glob progress #261

otakustay opened this issue Jan 9, 2024 · 1 comment

Comments

@otakustay
Copy link

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.

@sindresorhus
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants