js-combinatorics
js-combinatorics copied to clipboard
Writing the generated combinations to a file
I have generated a billion combinations using this. What is an efficient way to quickly write them to disc. So far i keep running out of memory while using fs methods.
I would create a readable stream from the generator of this library and a writable stream from 'fs' then just readable.pipe(writable) assuming you are using nodejs.
The issue is you aren't leaving node any time to flush the suitable stuff to disc.