DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Joe Enos
Joe Enos

Posted on

NodeJS Line Reader

Here's a simple way to use NodeJS to read lines from a textfile and do something with them.

It's reasonably straightforward, although not as straightforward as doing it in a language like C#.

You define a line reader from the readline package, and then subscribe to two events: line and close. From there, it's straight up ordinary JavaScript

Top comments (0)

🌚 Life is too short to browse without dark mode