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

Any way to stop/abort reading a file in the eachLine method? #47

Open
Michal2SAB opened this issue Nov 4, 2021 · 1 comment
Open

Any way to stop/abort reading a file in the eachLine method? #47

Michal2SAB opened this issue Nov 4, 2021 · 1 comment

Comments

@Michal2SAB
Copy link

Michal2SAB commented Nov 4, 2021

I need to stop reading a file once it gets to certain line & just stop whatever else is going on in the eachLine part. How can I do that? I've read through the docs and searched on the internet but found nothing that works. Please tell me it's possible to do

@TheSecurityDev
Copy link

TheSecurityDev commented Nov 16, 2021

Can't you just return false in the eachLine callback? The docs state: If the callback returns false, reading will stop and the file will be closed.

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