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

Include some onFile callback in findFiles2New? #226834

Closed
connor4312 opened this issue Aug 27, 2024 · 3 comments
Closed

Include some onFile callback in findFiles2New? #226834

connor4312 opened this issue Aug 27, 2024 · 3 comments
Assignees

Comments

@connor4312
Copy link
Member

Testing #226670

Back when I was using the findFiles API in js-debug, it would have been handy if there was a callback to get a file match as it's found so I could start processing them asynchonrously instead of getting them all at once in the returned promise

@alexdima
Copy link
Member

👍 Maybe an AsyncIterator

@connor4312
Copy link
Member Author

connor4312 commented Aug 27, 2024

Yes, I think returning an async iterable from the method would be a nice option. Currently conversion from that to an array for extensions is a bit annoying, but Node 22 will make that nicer.

@andreamah
Copy link
Contributor

I'm considering #226734, which should be sufficient for this use case. I would rather just have a general asyncIterator for all results rather than just onFile for a certain file, since having a general onResult event might lend itself to more use cases.

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

3 participants