It'd be better to rip all this stuff out and use the `seq-file` module instead: https://www.npmjs.org/package/seq-file