{"id":15835162,"url":"https://github.com/kaelzhang/error-stack","last_synced_at":"2025-03-15T08:32:00.311Z","repository":{"id":47690847,"uuid":"191514282","full_name":"kaelzhang/error-stack","owner":"kaelzhang","description":"Parse and manipulate error-stack","archived":false,"fork":false,"pushed_at":"2021-08-17T22:43:20.000Z","size":15,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-09T20:15:57.382Z","etag":null,"topics":["error"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaelzhang.png","metadata":{"files":{"readme":"README.md","changelog":"HISTORY.md","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":"2019-06-12T06:50:07.000Z","updated_at":"2021-10-29T17:43:48.000Z","dependencies_parsed_at":"2022-09-26T19:52:42.186Z","dependency_job_id":null,"html_url":"https://github.com/kaelzhang/error-stack","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ferror-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ferror-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ferror-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaelzhang%2Ferror-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaelzhang","download_url":"https://codeload.github.com/kaelzhang/error-stack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238880561,"owners_count":19546157,"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":["error"],"created_at":"2024-10-05T14:21:12.728Z","updated_at":"2025-03-15T08:31:58.248Z","avatar_url":"https://github.com/kaelzhang.png","language":"JavaScript","readme":"[![Build Status](https://travis-ci.org/kaelzhang/error-stack.svg?branch=master)](https://travis-ci.org/kaelzhang/error-stack)\n[![Coverage](https://codecov.io/gh/kaelzhang/error-stack/branch/master/graph/badge.svg)](https://codecov.io/gh/kaelzhang/error-stack)\n\u003c!-- optional appveyor tst\n[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/kaelzhang/error-stack?branch=master\u0026svg=true)](https://ci.appveyor.com/project/kaelzhang/error-stack)\n--\u003e\n\u003c!-- optional npm version\n[![NPM version](https://badge.fury.io/js/error-stack.svg)](http://badge.fury.io/js/error-stack)\n--\u003e\n\u003c!-- optional npm downloads\n[![npm module downloads per month](http://img.shields.io/npm/dm/error-stack.svg)](https://www.npmjs.org/package/error-stack)\n--\u003e\n\u003c!-- optional dependency status\n[![Dependency Status](https://david-dm.org/kaelzhang/error-stack.svg)](https://david-dm.org/kaelzhang/error-stack)\n--\u003e\n\n# error-stack\n\nParse and manipulate `error.stack`\n\n## Install\n\n```sh\n$ npm i error-stack\n```\n\n## Usage\n\n```js\nconst parse = require('error-stack')\nconst {stack} = new Error('foo')\n\nconsole.log(stack)\n// Error: foo\n//     at repl:1:11\n//     at Script.runInThisContext (vm.js:123:20)\n\nconst parsed = parse(stack)\n\nparsed.type // Error\n\nparsed.message  // foo\n\nparsed.traces\n// [\n//   {\n//     callee: undefined,\n//     source: 'repl',\n//     line: 1,\n//     col: 11\n//   },\n//   {\n//     callee: 'Script.runInThisContext',\n//     source: 'vm.js',\n//     line: 123,\n//     col: 20\n//   }\n// ]\n\nparsed\n.filter(({callee}) =\u003e !!callee)\n.format()\n// Error: foo\n//     at Script.runInThisContext (vm.js:123:20)\n```\n\n### parsed.type `string`\n\nError type\n\n### parsed.message `string`\n\nThe message used by Error constructor\n\n### parsed.traces `Array\u003cTrace\u003e`\n\n```ts\ninterface Source {\n  // The source of the the callee\n  source: string\n  line?: number\n  col?: number\n}\n\ninterface Trace extends Source{\n  callee: string\n  // Whether the callee is 'eval'\n  eval?: boolean\n  // The source location inside eval content\n  evalTrace: Source\n}\n```\n\n### parsed.filter(filterFunction): this\n\n- **filterFunction** `Function` the same as the callback function of `Array.prototype.filter(callback)`\n\nFilters the current traces\n\n### parsed.format(): string\n\nFormat object `parsed`\n\n## License\n\n[MIT](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Ferror-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaelzhang%2Ferror-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaelzhang%2Ferror-stack/lists"}