edasque / DynamoDBtoCSV

Dump DynamoDB data into a CSV file
Apache License 2.0
471 stars 152 forks source link

Write file out in stream. Fixes #28 #57

Closed brianfu9 closed 5 years ago

brianfu9 commented 5 years ago

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