dumpjson
v0.1.1
Published
Dump large Javascript objects to JSON file without using too much memory
Readme
DumpJSON
Dump large Javascript arrays to JSON file without using too much memory.
If you're looking for a way to read from JSON file into memory, check out jsonstrom.
Install
npm i dumpjsonUsage
const dumpjson = require('dumpjson')
// Filename to dump to
const writer = dumpjson('file.json')
// Very large array
const largeArray = [...]
for (const item of largeArray) {
dumpjson.write(item)
}
// Indicate end of stream
dumpjson.end()
// Await if you need to wait for all writes to finish
await dumpjson.end()MIT Licensed. Enjoy!
