{"_id":"traceback","_rev":"12-2195cf88000d53f016d66c05c7da66e0","name":"traceback","description":"Easy access to the call stack, written in pure JavaScript","dist-tags":{"latest":"0.3.1"},"versions":{"0.3.0":{"name":"traceback","version":"0.3.0","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Easy access to the call stack, written in pure JavaScript","keywords":["call","stack","trace","stacktrace","traceback","debug","line"],"homepage":"http://github.com/iriscouch/traceback","repository":{"type":"git","url":"git://github.com/iriscouch/traceback.git"},"engines":["node"],"dependencies":{},"devDependencies":{"tap":"0.1.3"},"main":"./api","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"_id":"traceback@0.3.0","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.2","_defaultsLoaded":true,"dist":{"shasum":"4e147f07cd332fbd0330ba510b942a5c9256a0ab","tarball":"https://registry.npmjs.org/traceback/-/traceback-0.3.0.tgz","integrity":"sha512-3chiDGarSmyOo9qtav4TB16MavEBEmS4a8CeYYmJ4nmDouNvAskmZ67lNJ7wz1cR2pWW1Jb61nBaE/xFD98dYg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZN8iV6dDtUifNFsPy3nH/Up49QA37Vj4ri/VlWsB6TAiBCVMX+SXhxRNlPPX4r+1H0L5WHe5RPN/wr8/q4Qjx8Ww=="}]},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]},"0.3.1":{"name":"traceback","version":"0.3.1","author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"description":"Easy access to the call stack, written in pure JavaScript","keywords":["call","stack","trace","stacktrace","traceback","debug","line"],"homepage":"http://github.com/iriscouch/traceback","repository":{"type":"git","url":"git://github.com/iriscouch/traceback"},"engines":["node"],"scripts":{"test":"tap test/"},"dependencies":{},"devDependencies":{"tap":"~0.4.12"},"main":"./api","bugs":{"url":"https://github.com/iriscouch/traceback/issues"},"_id":"traceback@0.3.1","dist":{"shasum":"64ef24a8168fcbe37ab17be3e99a40248b0bff85","tarball":"https://registry.npmjs.org/traceback/-/traceback-0.3.1.tgz","integrity":"sha512-tRwgY+v7rOrM6a9DnlOZVurgUqOAZUHLWce271euzBUT8pmSkJfNVa4H+OWEwiKdiOqer9JaWt6+lDHmBrt7Iw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG8FD/CnFl0njX+eDwq0R9rl6kAID85w6qpBMEfecM/bAiAP+3aAvZZSpU/bA+9Pw/ydWvJYcHs4+pHLaCW9xLhvtA=="}]},"_from":".","_npmVersion":"1.3.24","_npmUser":{"name":"jhs","email":"jhs@iriscouch.com"},"maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}]}},"readme":"# Traceback: easy access to the call stack, for Node.js\n\nWriting a Node app? Need to know the function backtrace? Don't want to compile C++ code? Use Traceback.\n\nTraceback provides a normal JavaScript array of the execution stack frames. You can see function names, line numbers, and other useful stuff.\n\nTraceback is available from NPM.\n\n    $ npm install traceback\n\n## Example\n\n**example.js**\n\n```javascript\nvar traceback = require('../traceback');\n\nfunction start() { first() }\nfunction first() { second() }\nvar second = function() { last() }\n\nfunction last() {\n  var stack = traceback();\n  console.log('I am ' + stack[0].name + ' from file ' + stack[0].file)\n\n  for(var i = 1; i <= 3; i++)\n    console.log('  ' + i + ' above me: ' + stack[i].name + ' at line ' + stack[i].line);\n}\n\nstart();\n```\n\nOutput:\n\n    I am last from file example.js\n      1 above me: second at line 5\n      2 above me: first at line 4\n      3 above me: start at line 3\n\n## Usage\n\nSimply calling `traceback()` gives you the stack, with the current function in position 0.\n\nStack frame objects have normal V8 [CallSite][callsite] objects as prototypes. All those methods will work. You can also call `traceback.raw()` to get the exact stack made by V8.\n\nBut `traceback()`'s stack frame objects have convenient attribute names:\n\n* **name** | The function name\n* **path** | The absolute path of the file defining the function\n* **file** | The basename of the `path` file (`\"example.js\"`)\n* **line** | The line number in the file\n* **col** | The column number in the file\n* **pos** | The byte position in the file\n* **fun** | The function itself\n* **method** | If this function was called as a method, the name it is stored as\n* **this** | The object bound to the label `this` in the function\n* **type** | The type of `this`; the name of the constructor function (Object, ReadStream, etc.)\n* **origin** | The `CallSite` that ran `eval()`, if this frame is an eval\n* **is_top** | Boolean indicating whether the function was called with a global `this`\n* **is_eval** | Boolean indicating whether the function comes from an `eval()` call\n* **is_native** | Boolean indicating whether the function is native\n* **is_ctor** | Boolean indicating whether this is a constructor (`new`) call\n\nThey also work correctly in `JSON.stringify()`.\n\n## Tests\n\nTests use [node-tap][tap]. Clone this Git repository, run `npm install` and then run the tests through npm:\n\n    $ npm test\n\n    > traceback@0.3.1 test /Users/jhs/src/traceback\n    > tap test/\n\n    ok test/api.js ...................................... 326/326\n    ok test/fail.js ....................................... 36/36\n    ok test/format.js ....................................... 7/7\n    ok test/readme.js ....................................... 2/2\n    total ............................................... 371/371\n\n    ok\n\n## License\n\nApache 2.0\n\n[callsite]: http://code.google.com/p/v8/wiki/JavaScriptStackTraceApi\n[tap]: https://github.com/isaacs/node-tap\n","maintainers":[{"name":"jhs","email":"jhs@iriscouch.com"}],"time":{"modified":"2022-06-27T19:33:40.798Z","created":"2011-12-14T16:13:22.211Z","0.3.0":"2011-12-14T16:13:27.809Z","0.3.1":"2014-08-19T08:12:14.755Z"},"author":{"name":"Jason Smith","email":"jhs@iriscouch.com"},"repository":{"type":"git","url":"git://github.com/iriscouch/traceback"},"homepage":"http://github.com/iriscouch/traceback","keywords":["call","stack","trace","stacktrace","traceback","debug","line"],"bugs":{"url":"https://github.com/iriscouch/traceback/issues"},"readmeFilename":"README.md","users":{"ikoala":true,"zkochan":true,"fr-esco":true,"jtyjty99999":true,"jondotsoy":true}}