1.0.5 • Published 10 years ago
callers-path v1.0.5
callers-path
V8 stacktrace API based caller's path
install
npm install --save callers-pathusage
example/moduleB.js
var callersPath = require('callers-path');
module.exports = function(){
console.log(callersPath());
};example/moduleA.js
var moduleB = require('./moduleB');
moduleB();
// => example/moduleA.jsdocumentation
require('callers-path')([frames, origin])
framesif specified should be anintegerbigger than0orInfinity.originif specified should be a function.- if no arguments, the default number of
framesis2so theoriginis the module itself. The stack is sliced by one.
why
You would like to set how many frames are recorded (Error.stackTraceLimit) and from which function the stack should be traced back (Error.captureStackTrace).
By default two frames are recorded, though you can even lower it to one providing a function from which start.
inspirated by
It serves for the same use cases implemented on this cool modules
test
npm testlicense
1.0.5
10 years ago
1.0.4
10 years ago
1.0.3
11 years ago
1.0.2
11 years ago
1.0.1
11 years ago
1.0.0
11 years ago
0.9.11
11 years ago
0.9.10
11 years ago
0.9.9
11 years ago
0.9.8
11 years ago
0.9.7
11 years ago
0.9.6
11 years ago
0.9.5
11 years ago
0.9.4
11 years ago
0.9.3
11 years ago
0.9.2
11 years ago
0.9.1
11 years ago
0.9.0
11 years ago