const heapdump = require('heapdump'); setTimeout( ()=>{ heapdump.writeSnapshot(`${process.cwd()}/` + Date.now() + '.heapsnapshot'); }, 12000 );