On nodejs, I’m trying to get the first line of a file.
For that, I’m using the readline
package as mentioned in this answer.
But since I’m only trying to get the first line, I’d need to get the readline
object to output its first element. I found how to do that in this answer, but it looks like it only works for synchronous iterators.
How do you get the first element of an async iterator?