{"id":15668891,"url":"https://github.com/jaydenseric/replace-stack-traces","last_synced_at":"2025-04-12T22:06:23.241Z","repository":{"id":57353730,"uuid":"453554678","full_name":"jaydenseric/replace-stack-traces","owner":"jaydenseric","description":"A JavaScript function to replace error stack traces and following Node.js versions at any indent in a multiline string.","archived":false,"fork":false,"pushed_at":"2022-08-18T08:16:37.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T22:06:19.677Z","etag":null,"topics":["esm","maintained","mjs","node","typescript"],"latest_commit_sha":null,"homepage":"https://npm.im/replace-stack-traces","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/jaydenseric.png","metadata":{"files":{"readme":"readme.md","changelog":"changelog.md","contributing":null,"funding":".github/funding.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"jaydenseric"}},"created_at":"2022-01-30T00:43:25.000Z","updated_at":"2025-01-03T14:01:37.000Z","dependencies_parsed_at":"2022-08-31T22:01:06.922Z","dependency_job_id":null,"html_url":"https://github.com/jaydenseric/replace-stack-traces","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Freplace-stack-traces","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Freplace-stack-traces/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Freplace-stack-traces/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaydenseric%2Freplace-stack-traces/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaydenseric","download_url":"https://codeload.github.com/jaydenseric/replace-stack-traces/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248637769,"owners_count":21137538,"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":["esm","maintained","mjs","node","typescript"],"created_at":"2024-10-03T14:20:26.565Z","updated_at":"2025-04-12T22:06:23.213Z","avatar_url":"https://github.com/jaydenseric.png","language":"JavaScript","funding_links":["https://github.com/sponsors/jaydenseric"],"categories":[],"sub_categories":[],"readme":"# replace-stack-traces\n\nA JavaScript function to replace error stack traces and following Node.js versions at any indent in a multiline string.\n\nUseful for snapshot testing CLI stderr output containing error stack traces, because:\n\n- Different Node.js versions generate different error stack traces, and v17.0.0+ appends the Node.js version if the error caused the process to exit.\n- Editing modules that affect the line and column numbers, etc. in the error stack traces requires the snapshots to be updated annoyingly often.\n\n## Installation\n\nFor [Node.js](https://nodejs.org), to install [`replace-stack-traces`](https://npm.im/replace-stack-traces) with [npm](https://npmjs.com/get-npm), run:\n\n```sh\nnpm install replace-stack-traces\n```\n\nFor [Deno](https://deno.land), an example import map:\n\n```json\n{\n  \"imports\": {\n    \"replace-stack-traces\": \"https://unpkg.com/replace-stack-traces@2.0.0/replaceStackTraces.mjs\"\n  }\n}\n```\n\nThen, import and use the function [`replaceStackTraces`](./replaceStackTraces.mjs).\n\n## Requirements\n\nSupported runtime environments:\n\n- [Node.js](https://nodejs.org) versions `^14.17.0 || ^16.0.0 || \u003e= 18.0.0`.\n- [Deno](https://deno.land).\n\nNon [Deno](https://deno.land) projects must configure [TypeScript](https://typescriptlang.org) to use types from the ECMAScript modules that have a `// @ts-check` comment:\n\n- [`compilerOptions.allowJs`](https://typescriptlang.org/tsconfig#allowJs) should be `true`.\n- [`compilerOptions.maxNodeModuleJsDepth`](https://typescriptlang.org/tsconfig#maxNodeModuleJsDepth) should be reasonably large, e.g. `10`.\n- [`compilerOptions.module`](https://typescriptlang.org/tsconfig#module) should be `\"node16\"` or `\"nodenext\"`.\n\n## Exports\n\nThe [npm](https://npmjs.com) package [`replace-stack-traces`](https://npm.im/replace-stack-traces) features [optimal JavaScript module design](https://jaydenseric.com/blog/optimal-javascript-module-design). These ECMAScript modules are exported via the [`package.json`](./package.json) field [`exports`](https://nodejs.org/api/packages.html#exports):\n\n- [`replaceStackTraces.mjs`](./replaceStackTraces.mjs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Freplace-stack-traces","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaydenseric%2Freplace-stack-traces","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaydenseric%2Freplace-stack-traces/lists"}