heapdump-promise
v1.0.0
Published
A promise to take a heap dump
Maintainers
Readme
heapdump-promise
Wraps headpdump in a promise compatible API.
Installation
$ npm install --save heapdump-promiseUsage
const writeHeapSnapshot = require('heapdump-promise')
writeHeapSnapshot()
.then((path) => {
console.info(`A heap dump was written to ${path}`)
})
.catch((error) => {
console.error(`Could not write heap dump because ${error}`)
})All arguments are passed to heapdump.writeSnapshot() as-is:
const writeHeapSnapshot = require('heapdump-promise')
const path = '/tmp/my-process.' + Date.now() + '.snapshot'
writeHeapSnapshot(path)
.then((path) => {
console.info(`A heap dump was written to ${path}`)
})
.catch((error) => {
console.error(`Could not write heap dump because ${error}`)
})