callsite
access to v8's CallSites
Last updated 7 years ago by tjholowaychuk .
Original npm · Tarball · package.json
$ cnpm install callsite 
SYNC missed versions from official npm registry.

callstack

Access to v8's "raw" CallSites.

Installation

$ npm install callsite

Example

var stack = require('callsite');

foo();

function foo() {
  bar();
}

function bar() {
  baz();
}

function baz() {
  console.log();
  stack().forEach(function(site){
    console.log('  \033[36m%s\033[90m in %s:%d\033[0m'
      , site.getFunctionName() || 'anonymous'
      , site.getFileName()
      , site.getLineNumber());
  });
  console.log();
}

Why?

Because you can do weird, stupid, clever, wacky things such as:

License

MIT

Current Tags

  • 1.0.0                                ...           latest (7 years ago)

3 Versions

  • 1.0.0                                ...           7 years ago
  • 0.0.2                                ...           9 years ago
  • 0.0.1                                ...           9 years ago
Maintainers (1)
Downloads
Today 303
This Week 5,105
This Month 52,938
Last Day 4,802
Last Week 29,437
Last Month 116,768
Dependencies (0)
None
Dev Dependencies (2)
Dependents (486)

Copyright 2014 - 2016 © taobao.org |