Collects 5000 lines and streams to an opened file before clearing memory for the next 5000 lines so that the entire array does not need to be stored in memory. Also prints out last written key so a read can be resumed from that point instead of starting over.
Collects 5000 lines and streams to an opened file before clearing memory for the next 5000 lines so that the entire array does not need to be stored in memory. Also prints out last written key so a read can be resumed from that point instead of starting over.
The stream automatically closes on 'error' or 'finish'. https://nodejs.org/api/fs.html#fs_fs_createwritestream_path_options
Fixes #28