Skip to content

Instantly share code, notes, and snippets.

@agreatfool
Created January 25, 2018 08:42
Show Gist options
  • Save agreatfool/0980b5bd950d120b8751114817e0f30c to your computer and use it in GitHub Desktop.
Save agreatfool/0980b5bd950d120b8751114817e0f30c to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
// node --expose-gc --trace-gc cases/leak-and-gc.js --normal | node cases/pipe-gc-parser.js
// node --expose-gc --trace-gc-nvp cases/leak-and-gc.js --normal | node cases/pipe-gc-parser.js
"use strict";
const readline = require("readline");
const GcParser = require("v8-gc-log-parser");
const parser = new GcParser();
const rl = readline.createInterface({
input: process.stdin
});
rl.on("line", (data) => {
// console.log(data);
console.log(parser.parseAllToData(data));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment