Deno: Read file line by line

Created on 24 May 2020  路  4Comments  路  Source: denoland/deno

I've created a very small utility to read a file line by line using the information from #4007 for a project I'm working on.
I can make a pull request to add it to the third-party libs but I think this makes more sense in the standard libs.
What do you think?
https://github.com/JWebCoder/deno_readline

Most helpful comment

@ry thank you for the feedback
@nayeemrmn I tested that and its a lot faster, thank you for the tip. Also, I use this readline only for simple files, so the readlines from bufio works perfectly.
Apart from this, bufio has no documentation, is anyone working on that? I can give some help on that if needed.

All 4 comments

@JWebCoder Actually we've already got some readline functionality built-in to Deno. We use it for the REPL. However it's not exposed to the public.
You can see it in action here: https://github.com/denoland/deno/blob/f6e31603563bad38c663494ddec6a363989b5786/cli/js/repl.ts#L129
So I agree that this is something useful for the standard library, but we have to decide how we're going to expose this internal functionality... It's probably better to iterate on your module outside of std for now.

@ry thank you for the feedback
@nayeemrmn I tested that and its a lot faster, thank you for the tip. Also, I use this readline only for simple files, so the readlines from bufio works perfectly.
Apart from this, bufio has no documentation, is anyone working on that? I can give some help on that if needed.

Apart from this, bufio has no documentation, is anyone working on that? I can give some help on that if needed.

@JWebCoder go ahead, documentation PRs are always welcome :) Seems like this issue is resolved after all, so closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

metakeule picture metakeule  路  3Comments

ry picture ry  路  3Comments

sh7dm picture sh7dm  路  3Comments

kyeotic picture kyeotic  路  3Comments

ry picture ry  路  3Comments