Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Send a signal to the current process (see raise(3))
JavaScript
branch: master
Failed to load latest commit information.
test
.gitignore
README.md Initial Commit
package.json
raise.js

README.md

raise

Send a signal to the current process (see raise(3))

Installation

npm install raise

Usage

var raise = require('raise');

// unceremoniously end this process
raise('SIGKILL');

Uses

This can be useful for debugging purposes. A lot of times I've used DTrace to pause a process when it hits a certain code path so I can inspect its memory. With this module, you can simply add a raise statement where you would like to send a signal to the process.

var raise = require('raise');

var a = [];
for (var i = 0; i < 100; i++) {
  a.push(a); // obvious bug

  // say you thought this function was a problem, but you couldn't identify why,
  // pause the process on the 10th iteration to coredump and inspect the memory
  if (i === 10) raise('SIGSTOP');
}

License

MIT

Something went wrong with that request. Please try again.