heapdump-promise

1.0.0 • Public • Published

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

/heapdump-promise/

    Package Sidebar

    Install

    npm i heapdump-promise

    Weekly Downloads

    15

    Version

    1.0.0

    License

    ISC

    Last publish

    Collaborators

    • achingbrain