readline
Version:
Simple streaming readline module.
50 lines (34 loc) • 911 B
Markdown
> Read a file line by line.
[](https://www.npmjs.com/package/linebyline)
```sh
npm install linebyline
```
```sh
npm install .
npm test
```
Simple streaming readline module for NodeJS. Reads a file and buffer new lines emitting a _line_ event for each line.
```js
var readline = require('linebyline'),
rl = readline('./somefile.txt');
rl.on('line', function(line, lineCount, byteCount) {
// do something with the line of text
})
.on('error', function(e) {
// something went wrong
});
```
* **** *readingObject* {file path or stream}
* **EventEmitter**
BSD © [Craig Brookes](http://craigbrookes.com/)