Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including poop with all npm packages installed. Try it out:

var poop = require("poop")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

poop v3.0.1

Hapi plugin for taking a process dump on uncaught exception

poop Logo

hapi plugin for taking a process dump and cleaning up after an uncaught exception

Current Version Build Status

Lead Maintainer: Colin Ihrig

Table of Contents


When an uncaughtException is encountered a heap dump will be output to the plugin folder. A log file is also written containing the exception details. After this is complete the process will exit with a failure code. Heap dumps can also be taken at arbitrary times by sending a SIGUSR1 signal to the server process.


The following example shows how to register and configure poop. In this example, an uncaught exception is thrown after poop is registered. This will trigger a heap dump and poop.log file to be created.

'use strict';
var Path = require('path');
var Hapi = require('hapi');
var Poop = require('poop');
var server = new Hapi.Server();

    register: Poop,
    options: {
        logPath: Path.join(__dirname, 'poop.log')
}, function () {

    throw new Error('uncaught');


The following options are available when configuring poop.


The directory to place heap dump files. Defaults to the process current working directory.


The file path to log any uncaught exception errors. Defaults to poop.log in the process current working directory.


Options passed to the write stream of the log file. Uses Node's defaults:

    flags: 'w',
    encoding: null,
    fd: null,
    mode: 0666


RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free