Skip to content

Instantly share code, notes, and snippets.

@pumbaEO
Created March 13, 2015 11:35
Show Gist options
  • Save pumbaEO/26cd3d8a39ab9e71a698 to your computer and use it in GitHub Desktop.
Save pumbaEO/26cd3d8a39ab9e71a698 to your computer and use it in GitHub Desktop.
node --max-old-space-size=60096 test.js
var fs = require('fs');
var filePath = 'coverage.json';
var importStream = fs.createReadStream(filePath, {flags: 'r', encoding: 'utf-8'});
importStream.on('data', function(chunk) {
console.info(chunk);
var pleaseBeAJSObject = JSON.parse(chunk);
// insert pleaseBeAJSObject in a database
});
importStream.on('end', function(item) {
console.log("Woot, imported objects into the database!");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment