{"id":19574688,"url":"https://github.com/stringparser/v8-callsites","last_synced_at":"2025-04-27T06:30:33.340Z","repository":{"id":57390026,"uuid":"24380412","full_name":"stringparser/v8-callsites","owner":"stringparser","description":"V8 stacktrace API callsites with knobs","archived":false,"fork":false,"pushed_at":"2015-12-19T14:04:49.000Z","size":28,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-31T16:58:25.168Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stringparser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-09-23T16:48:25.000Z","updated_at":"2019-08-12T19:40:36.000Z","dependencies_parsed_at":"2022-09-15T05:20:29.673Z","dependency_job_id":null,"html_url":"https://github.com/stringparser/v8-callsites","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fv8-callsites","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fv8-callsites/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fv8-callsites/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stringparser%2Fv8-callsites/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stringparser","download_url":"https://codeload.github.com/stringparser/v8-callsites/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224062768,"owners_count":17249289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T06:43:26.129Z","updated_at":"2024-11-11T06:43:26.969Z","avatar_url":"https://github.com/stringparser.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# v8-callsites [![NPM version][npm-badge]][npm-link] [![downloads][npm-downloads-badge]][npm-link]\n\n[![build][travis-badge]][travis-link]\n\n[V8 stacktrace API](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi) callsites with knobs.\n\n## install\n\n    npm install --save v8-callsites\n\n## usage\n\n```js\nvar stack = require('v8-callsites');\n\norigin();\n\nfunction origin(){\n  foo();\n}\n\nfunction foo(){\n  bar();\n}\n\nfunction bar(){\n  baz();\n}\n\nfunction baz(){\n\n  var barStackFrombaz = stack(3, bar);\n  // bar `stack` from baz with only 3 frames\n\n  barstackFrombaz.forEach(function(frame){\n    console.log(\n      frame.getFunctionName(), '-\u003e', frame+''\n    );\n  });\n}\n\n```\n\n### documentation\n\n`require('v8-callsites')([frames, origin])`\n\n - `frames` if specified should be an `integer` bigger than `0` or `Infinity`.\n - `origin` if specified should be a function.\n - if no arguments, the default number of `frames` is `2` so the `origin` is the module itself. The returned stack is sliced by one.\n\nSee also the [avaliable methods](https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi) of the stack trace api like:\n - `getLineNumber`\n - `getFileName`\n - `getEvalOrigin`\n - etc.\n\n## why\n\nYou would like to set how many frames are recorded (`Error.stackTraceLimit`) and from which function the stack should be traced back (`Error.captureStackTrace`).\n\nBy default two frames are recorded, though you can even lower it to one providing a function from which start.\n\n### inspirated by\n\nIt serves for the same use cases implemented on this cool modules\n\n - [visionmedia `callsite`](https://github.com/visionmedia/callsite)\n - [sindresorhus `callsites`](https://github.com/sindresorhus/callsites)\n\nI've been using those a lot.\n\n## test\n\n    npm test\n\n### license\n\n[![LICENSE](http://img.shields.io/npm/l/v8-callsites.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\n\u003c!-- links --\u003e\n[npm-link]: http://www.npmjs.org/package/v8-callsites\n[npm-badge]: http://img.shields.io/npm/v/v8-callsites.svg?style=flat-square\n\n[npm-downloads-badge]: http://img.shields.io/npm/dm/v8-callsites.svg?style=flat-square\n\n[travis-link]: https://travis-ci.org/stringparser/v8-callsites/builds\n[travis-badge]: http://img.shields.io/travis/stringparser/v8-callsites/master.svg?style=flat-square\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringparser%2Fv8-callsites","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstringparser%2Fv8-callsites","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstringparser%2Fv8-callsites/lists"}