Socket
Socket
Sign inDemoInstall

raw-stacktrace

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raw-stacktrace

Emit raw stacktraces when errors are thrown


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Weekly downloads
 
Created
Source

node-raw-stacktraces

Get raw stack traces when errors are thrown.

Optionally customize the format of stack traces.

Example

var raw = require('raw-stacktrace');
var traces = raw();

traces.on("trace", function(err, callsites){
  console.log(callsites[0]);
});

traces.formatter(function(err, callsites){
  return "custom stack trace output";
});

(function testError(){ 
  throw new Error("test");
}).bind({ context: "someContext" })();

Output

{ this: { context: 'someContext' },
  type: 'Object',
  isTop: false,
  isEval: false,
  origin: '/Users/jb55/src/coffeescript/node-raw-stacktrace/example.js',
  script: '/Users/jb55/src/coffeescript/node-raw-stacktrace/example.js',
  fun: [Function: testError],
  name: 'testError',
  method: null,
  path: '/Users/jb55/src/coffeescript/node-raw-stacktrace/example.js',
  line: 11,
  col: 9,
  isNative: false,
  pos: 277,
  isCtor: false,
  file: 'example.js',
  toJSON: [Function: toJSON] }
custom stack trace output

Adding callsites to the Error object

var raw = require('raw-stacktrace');
var traces = raw();

traces.on("trace", function(err, callsites){
  err.callsites = callsites;
});

FAQs

Package last updated on 15 Mar 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc