arnaucube
arnaucube/raspberryGPIOhtmlserverPublic Self-hosted repository
raspberryGPIOhtmlserver/node_modules/callsite/Readme.md
node_modules/callsite/Readme.mdRaw
 1# callstack
 2
 3  Access to v8's "raw" `CallSite`s.
 4
 5## Installation
 6
 7    $ npm install callsite
 8
 9## Example
10
11```js
12var stack = require('callsite');
13
14foo();
15
16function foo() {
17  bar();
18}
19
20function bar() {
21  baz();
22}
23
24function baz() {
25  console.log();
26  stack().forEach(function(site){
27    console.log('  \033[36m%s\033[90m in %s:%d\033[0m'
28      , site.getFunctionName() || 'anonymous'
29      , site.getFileName()
30      , site.getLineNumber());
31  });
32  console.log();
33}
34```
35
36## Why?
37
38  Because you can do weird, stupid, clever, wacky things such as:
39
40  - [better-assert](https://github.com/visionmedia/better-assert)
41
42## License
43
44  MIT