1.0.0 • Published 8 years ago

heapdump-promise v1.0.0

Weekly downloads
32
License
ISC
Repository
github
Last release
8 years ago

heapdump-promise

Dependency status Build status Coverage status

Wraps headpdump in a promise compatible API.

Installation

$ npm install --save heapdump-promise

Usage

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}`)
  })