{"id":25590685,"url":"https://github.com/bugsplat-git/source-mapper","last_synced_at":"2025-08-16T08:23:31.597Z","repository":{"id":38418384,"uuid":"345203011","full_name":"BugSplat-Git/source-mapper","owner":"BugSplat-Git","description":"📚➡️🥞 Node.js module for converting mangled stack traces to original positions in transpiled JS/TS code.","archived":false,"fork":false,"pushed_at":"2024-12-03T02:51:40.000Z","size":2980,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-08T14:22:38.270Z","etag":null,"topics":["bugsplat","callstack","error","javascript","stacktrace","transpilation","typescript","uglified-and-concatenated-js-file","unwind"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/BugSplat-Git.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-03-06T21:53:17.000Z","updated_at":"2024-12-30T16:23:33.000Z","dependencies_parsed_at":"2022-08-24T00:10:32.750Z","dependency_job_id":"3807a739-17d2-49c7-8402-1cc410c3b47c","html_url":"https://github.com/BugSplat-Git/source-mapper","commit_stats":null,"previous_names":["bugsplat-git/source-mapper","bugsplat-git/stack-converter"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/BugSplat-Git/source-mapper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fsource-mapper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fsource-mapper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fsource-mapper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fsource-mapper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BugSplat-Git","download_url":"https://codeload.github.com/BugSplat-Git/source-mapper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Fsource-mapper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270684943,"owners_count":24627907,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["bugsplat","callstack","error","javascript","stacktrace","transpilation","typescript","uglified-and-concatenated-js-file","unwind"],"created_at":"2025-02-21T09:22:53.530Z","updated_at":"2025-08-16T08:23:31.578Z","avatar_url":"https://github.com/BugSplat-Git.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com)\n\u003cbr/\u003e\n# \u003cdiv align=\"center\"\u003eBugSplat\u003c/div\u003e \n### **\u003cdiv align=\"center\"\u003eCrash and error reporting built for busy developers.\u003c/div\u003e**\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://twitter.com/BugSplatCo\"\u003e\n        \u003cimg alt=\"Follow @bugsplatco on Twitter\" src=\"https://img.shields.io/twitter/follow/bugsplatco?label=Follow%20BugSplat\u0026style=social\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/K4KjjRV5ve\"\u003e\n        \u003cimg alt=\"Join BugSplat on Discord\" src=\"https://img.shields.io/discord/664965194799251487?label=Join%20Discord\u0026logo=Discord\u0026style=social\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n# 🗺️ source-mapper\n`source-mapper` is a utility for translating function names, file names and line numbers in uglified JavaScript Error stack frames to the corresponding values in the original source. `source-mapper` is distributed as both a package and a library and is used by the [BugSplat](https://www.bugsplat.com) backend to deliver crash reporting as a service for JavaScript and TypeScript applications.\n\nThe following is an example JavaScript Error stack converted to its TypeScript equivalent using `source-mapper`:\n\n```\nError: BugSplat rocks!\n    at crash (/Users/bobby/Desktop/bugsplat/source-mapper/dist/bin/cmd.js:16:11)\n    at /Users/bobby/Desktop/bugsplat/source-mapper/dist/bin/cmd.js:6:9\n    at Object.\u003canonymous\u003e (/Users/bobby/Desktop/bugsplat/source-mapper/dist/bin/cmd.js:14:3)\n```\n\n```\nError: BugSplat rocks!\n    at crash (../../bin/cmd.ts:15:10)\n    at \u003cunknown\u003e (../../bin/cmd.ts:5:8)\n    at Object.\u003canonymous\u003e (../../bin/cmd.ts:12:2)\n```\n\n## 🖥 Command Line\n\n1. Install this package globally `npm i -g @bugsplat/source-mapper`\n2. Run `source-mapper -h` to see the latest usage information:\n\n```bash\nbobby@BugSplat % ~ % source-mapper -h\n\n    @bugsplat/source-mapper contains a command line utility and set of libraries to help you demangle JavaScript stack frames.\n\n    source-mapper command line usage:\n\n        source-mapper [ [ \"/source-map-directory\" OR \"/source.js.map\" ] [ \"/stack-trace.txt\" ] ]\n    \n    * Optionally provide either a path to a directory containing source maps or a .map.js file - Defaults to the current directory\n    * Optionally provide a path to a .txt file containing a JavaScript Error stack trace - Defaults to the value in the clipboard\n    \n    ❤️ support@bugsplat.com\n```\n\n3. Run `source-mapper` and optionally specify a path to a directory containing .js.map files, path to a single .js.map file, and a path to a .txt file containing a stringified JavaScript Error. If no options are provided `source-mapper` will default to looking in the current directory for source maps and attempt to read the stringified JavaScript error stack from the system clipboard.\n\n## 🧩 API\n\n1. Install this package locally `npm i @bugsplat/source-mapper`\n2. Import `SourceMapper` from `@bugsplat/source-mapper`\n\n```ts\nimport { SourceMapper } from '@bugsplat/source-mapper';\n```\n\n3. Create a new instance of `SourceMapper` passing it an array of paths to source map files. You can also await the static factory function `createFromDirectory(directory: string): Promise\u003cSourceMapper\u003e` which takes a path to a directory and creates a new SourceMapper with an array of source map file paths it finds in the specified directory\n\n```ts\nconst mapper = new SourceMapper(sourceMapFilePaths);\n```\n\n```ts\nconst mapper = await SourceMapper.createFromDirectory(directory);\n```\n\n4. Await the call to convert passing it the stack property from a JavaScript Error object\n```ts\nconst result = await mapper.convert(error.stack);\n```\n\nThanks for using BugSplat!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fsource-mapper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugsplat-git%2Fsource-mapper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Fsource-mapper/lists"}