nickewing / line-reader

Asynchronous line-by-line file reader for node.js
MIT License
453 stars 75 forks source link

README examples work as is #33

Closed steveinatorx closed 8 years ago

steveinatorx commented 8 years ago

The first two README examples might be confusing using /* done */ instead of the proper callback "last".

minor point

nickewing commented 8 years ago

Hi @steveinatorx - The point of returning the conditional there was to illustrate that you can terminate iteration early by returning false or by passing false to the callback. The if (/* done */) { was meant to signify some arbitrary condition on which to end the iteration early. I don't think using if (last) { would make sense in the example because there would be no reason to request stopping the iteration when it's already at the last iteration.

steveinatorx commented 8 years ago

ok that explanation makes more sense.