Consider the code below ... I am trying to pause the stream after reading the first 5 lines:
var fs = require(\'fs\');
var readline = require(\'r
So, it turns out that the readline stream tends to "drip" (i.e., leak a few extra lines) even after a pause(). The documentation does not make this clear, but it's true.
If you want the pause() toggle to appear immediate, you'll have to create your own line buffer and accumulate the leftover lines yourself.