views:

281

answers:

2

Does anyone know how to print a stack trace in nodejs?

A: 

http://github.com/emwendelin/javascript-stacktrace This looks promising.

Sijin
+4  A: 

Any Error object has a stack member that traps the point at which it was constructed.

var stack = new Error().stack
require("sys").puts( stack )
isaacs
or just `sys.puts(new Error().stack)` (after adding the system module)
sirhc