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

Is there an option to stop on first match? #50

Open
yury-kozlov opened this issue Dec 25, 2019 · 2 comments
Open

Is there an option to stop on first match? #50

yury-kozlov opened this issue Dec 25, 2019 · 2 comments

Comments

@yury-kozlov
Copy link

I'm interested in finding just the first occurrence of requested file. But due to a complex directory structure in our repo the scan takes much time.
It would be a great optimization feature if you expose some API to limit the number of matches to top X, or may be evaluate some callback method in order to stop search or continue.

@stefanpenner
Copy link
Collaborator

stefanpenner commented Feb 28, 2020

@yury-kozlov ya, it would be neat. Maybe something like:

for (let x of walkSync.iterator(/* regular walk sync options*/)) {
  if (x === /* what you are looking for */) {
    return x;
  }
}

@rwjblue
Copy link
Contributor

rwjblue commented Mar 18, 2020

Ya, agree. I'd love this too.

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

No branches or pull requests

3 participants