{"id":15365575,"url":"https://github.com/tunnckocore/clean-stacktrace-relative-paths","last_synced_at":"2025-10-29T02:10:46.679Z","repository":{"id":48000569,"uuid":"84668897","full_name":"tunnckoCore/clean-stacktrace-relative-paths","owner":"tunnckoCore","description":"Meant to be used with `clean-stacktrace` as mapper function. Makes absolute paths inside stack traces to relative paths.","archived":false,"fork":false,"pushed_at":"2023-01-12T06:06:04.000Z","size":383,"stargazers_count":2,"open_issues_count":9,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-08T07:42:52.001Z","etag":null,"topics":["clean","clean-stacktrace","error-stack-trace","plugin","relative-path","relative-paths","stack","stack-traces","stacktrace","utils"],"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/tunnckoCore.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-11T17:48:46.000Z","updated_at":"2023-09-02T11:34:54.000Z","dependencies_parsed_at":"2023-02-09T10:16:46.550Z","dependency_job_id":null,"html_url":"https://github.com/tunnckoCore/clean-stacktrace-relative-paths","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fclean-stacktrace-relative-paths","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fclean-stacktrace-relative-paths/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fclean-stacktrace-relative-paths/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tunnckoCore%2Fclean-stacktrace-relative-paths/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tunnckoCore","download_url":"https://codeload.github.com/tunnckoCore/clean-stacktrace-relative-paths/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249044107,"owners_count":21203602,"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":["clean","clean-stacktrace","error-stack-trace","plugin","relative-path","relative-paths","stack","stack-traces","stacktrace","utils"],"created_at":"2024-10-01T13:15:09.299Z","updated_at":"2025-10-15T10:29:39.667Z","avatar_url":"https://github.com/tunnckoCore.png","language":"JavaScript","funding_links":["https://www.paypal.me/tunnckoCore"],"categories":[],"sub_categories":[],"readme":"# relative-paths [![NPM version](https://img.shields.io/npm/v/clean-stacktrace-relative-paths.svg?style=flat)](https://www.npmjs.com/package/clean-stacktrace-relative-paths) [![mit license][license-img]][license-url] [![NPM monthly downloads](https://img.shields.io/npm/dm/clean-stacktrace-relative-paths.svg?style=flat)](https://npmjs.org/package/clean-stacktrace-relative-paths) [![npm total downloads][downloads-img]][downloads-url]\n\n\u003e Meant to be used with [clean-stacktrace][] as mapper function. Makes absolute paths inside stack traces to relative paths.\n\n[![code climate][codeclimate-img]][codeclimate-url] \n[![code style][standard-img]][standard-url] \n[![linux build][travis-img]][travis-url] \n[![windows build][appveyor-img]][appveyor-url] \n[![code coverage][coverage-img]][coverage-url] \n[![dependency status][david-img]][david-url]\n[![paypal donate][paypalme-img]][paypalme-url] \n\nYou might also be interested in [always-done](https://github.com/hybridables/always-done#readme).\n\n## Table of Contents\n- [Install](#install)\n- [Usage](#usage)\n- [API](#api)\n  * [relativePaths](#relativepaths)\n- [Related](#related)\n- [Contributing](#contributing)\n- [Building docs](#building-docs)\n- [Running tests](#running-tests)\n- [Author](#author)\n- [License](#license)\n\n_(TOC generated by [verb](https://github.com/verbose/verb) using [markdown-toc](https://github.com/jonschlinkert/markdown-toc))_\n\n## Install\nInstall with [npm](https://www.npmjs.com/)\n\n```\n$ npm install clean-stacktrace-relative-paths --save\n```\n\nor install using [yarn](https://yarnpkg.com)\n\n```\n$ yarn add clean-stacktrace-relative-paths\n```\n\n## Usage\n\u003e For more use-cases see the [tests](test.js)\n\n```js\nconst cleanStacktraceRelativePaths = require('clean-stacktrace-relative-paths')\n```\n\n## API\n\n### [relativePaths](index.js#L51)\n\u003e Cleans stack traces to use relative paths, instead of absolute paths. Pass a `cwd` if you want to customize, otherwise `process.cwd()` is used by default.\n\nMeant to be used as `mapper` argument in [clean-stacktrace][]\n\n**Params**\n\n* `[cwd]` **{String}**: custom current working directory    \n* `returns` **{Function}**: a function that can be passed as `mapper` to [clean-stacktrace][]  \n\n**Example**\n\n```js\nconst cleanStack = require('clean-stacktrace')\nconst relativePaths = require('clean-stacktrace-relative-paths')\n\nconst error = new Error('Missing unicorn')\nconsole.log(error.stack)\n// =\u003e\n// Error: Missing unicorn\n//     at Object.\u003canonymous\u003e (/Users/sindresorhus/dev/clean-stack/unicorn.js:2:15)\n//     at Module._compile (module.js:409:26)\n//     at Object.Module._extensions..js (module.js:416:10)\n//     at Module.load (module.js:343:32)\n//     at Function.Module._load (module.js:300:12)\n//     at Function.Module.runMain (module.js:441:10)\n//     at startup (node.js:139:18)\n\nconst mapper = relativePaths()\nconst stack = cleanStack(error.stack, mapper)\nconsole.log(stack)\n// =\u003e\n// Error: Missing unicorn\n//     at Object.\u003canonymous\u003e (unicorn.js:2:15)\n```\n\n## Related\n- [always-done](https://www.npmjs.com/package/always-done): Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement… [more](https://github.com/hybridables/always-done#readme) | [homepage](https://github.com/hybridables/always-done#readme \"Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100% of its tests plus more\")\n- [assert-kindof](https://www.npmjs.com/package/assert-kindof): Check native type of value and throw AssertionError if not okey. Clean stack traces. Simplicity. Built on [is-kindof][]. | [homepage](https://github.com/tunnckocore/assert-kindof#readme \"Check native type of value and throw AssertionError if not okey. Clean stack traces. Simplicity. Built on [is-kindof][].\")\n- [clean-stacktrace](https://www.npmjs.com/package/clean-stacktrace): Clean up error stack traces - just a fork of [clean-stack][]. Working on node.js v0.10 and above. | [homepage](https://github.com/tunnckocore/clean-stacktrace#readme \"Clean up error stack traces - just a fork of [clean-stack][]. Working on node.js v0.10 and above.\")\n- [is-async-function](https://www.npmjs.com/package/is-async-function): Is function really asynchronous function? Trying to guess that based on check if [common-callback-names][] exists as function arguments names or… [more](https://github.com/tunnckocore/is-async-function#readme) | [homepage](https://github.com/tunnckocore/is-async-function#readme \"Is function really asynchronous function? Trying to guess that based on check if [common-callback-names][] exists as function arguments names or you can pass your custom.\")\n- [kind-of-extra](https://www.npmjs.com/package/kind-of-extra): Additional functionality to [kind-of][] type check utility. Support promises, generators, streams, errors. | [homepage](https://github.com/tunnckocore/kind-of-extra#readme \"Additional functionality to [kind-of][] type check utility. Support promises, generators, streams, errors.\")\n- [minibase](https://www.npmjs.com/package/minibase): Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing… [more](https://github.com/node-minibase/minibase#readme) | [homepage](https://github.com/node-minibase/minibase#readme \"Minimalist alternative for Base. Build complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.\")\n- [redolent](https://www.npmjs.com/package/redolent): Simple promisify with sane defaults, works on node 0.10 if you provide custom Promise through options | [homepage](https://github.com/hybridables/redolent#readme \"Simple promisify with sane defaults, works on node 0.10 if you provide custom Promise through options\")\n- [try-catch-core](https://www.npmjs.com/package/try-catch-core): Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and… [more](https://github.com/hybridables/try-catch-core#readme) | [homepage](https://github.com/hybridables/try-catch-core#readme \"Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such as [always-done][] to handle completion of anything.\")\n\n## Contributing\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/clean-stacktrace-relative-paths/issues/new).  \nPlease read the [contributing guidelines](CONTRIBUTING.md) for advice on opening issues, pull requests, and coding standards.  \nIf you need some help and can spent some cash, feel free to [contact me at CodeMentor.io](https://www.codementor.io/tunnckocore?utm_source=github\u0026utm_medium=button\u0026utm_term=tunnckocore\u0026utm_campaign=github) too.\n\n**In short:** If you want to contribute to that project, please follow these things\n\n1. Please DO NOT edit [README.md](README.md), [CHANGELOG.md](CHANGELOG.md) and [.verb.md](.verb.md) files. See [\"Building docs\"](#building-docs) section.\n2. Ensure anything is okey by installing the dependencies and run the tests. See [\"Running tests\"](#running-tests) section.\n3. Always use `npm run commit` to commit changes instead of `git commit`, because it is interactive and user-friendly. It uses [commitizen][] behind the scenes, which follows Conventional Changelog idealogy.\n4. Do NOT bump the version in package.json. For that we use `npm run release`, which is [standard-version][] and follows Conventional Changelog idealogy.\n\nThanks a lot! :)\n\n## Building docs\nDocumentation and that readme is generated using [verb-generate-readme][], which is a [verb][] generator, so you need to install both of them and then run `verb` command like that\n\n```\n$ npm install verbose/verb#dev verb-generate-readme --global \u0026\u0026 verb\n```\n\n_Please don't edit the README directly. Any changes to the readme must be made in [.verb.md](.verb.md)._\n\n## Running tests\nClone repository and run the following in that cloned directory\n\n```\n$ npm install \u0026\u0026 npm test\n```\n\n## Author\n**Charlike Mike Reagent**\n\n+ [github/tunnckoCore](https://github.com/tunnckoCore)\n+ [twitter/tunnckoCore](https://twitter.com/tunnckoCore)\n+ [codementor/tunnckoCore](https://codementor.io/tunnckoCore)\n\n## License\nCopyright © 2017, [Charlike Mike Reagent](https://i.am.charlike.online). Released under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.4.3, on March 12, 2017._  \n_Project scaffolded using [charlike][] cli._\n\n[always-done]: https://github.com/hybridables/always-done\n[async-done]: https://github.com/gulpjs/async-done\n[base]: https://github.com/node-base/base\n[charlike]: https://github.com/tunnckocore/charlike\n[clean-stack]: https://github.com/sindresorhus/clean-stack\n[clean-stacktrace]: https://github.com/tunnckocore/clean-stacktrace\n[commitizen]: https://github.com/commitizen/cz-cli\n[common-callback-names]: https://github.com/tunnckocore/common-callback-names\n[dezalgo]: https://github.com/npm/dezalgo\n[is-kindof]: https://github.com/tunnckocore/is-kindof\n[kind-of]: https://github.com/jonschlinkert/kind-of\n[once]: https://github.com/isaacs/once\n[standard-version]: https://github.com/conventional-changelog/standard-version\n[verb-generate-readme]: https://github.com/verbose/verb-generate-readme\n[verb]: https://github.com/verbose/verb\n\n[license-url]: https://www.npmjs.com/package/clean-stacktrace-relative-paths\n[license-img]: https://img.shields.io/npm/l/clean-stacktrace-relative-paths.svg\n\n[downloads-url]: https://www.npmjs.com/package/clean-stacktrace-relative-paths\n[downloads-img]: https://img.shields.io/npm/dt/clean-stacktrace-relative-paths.svg\n\n[codeclimate-url]: https://codeclimate.com/github/tunnckoCore/clean-stacktrace-relative-paths\n[codeclimate-img]: https://img.shields.io/codeclimate/github/tunnckoCore/clean-stacktrace-relative-paths.svg\n\n[travis-url]: https://travis-ci.org/tunnckoCore/clean-stacktrace-relative-paths\n[travis-img]: https://img.shields.io/travis/tunnckoCore/clean-stacktrace-relative-paths/master.svg?label=linux\n\n[appveyor-url]: https://ci.appveyor.com/project/tunnckoCore/clean-stacktrace-relative-paths\n[appveyor-img]: https://img.shields.io/appveyor/ci/tunnckoCore/clean-stacktrace-relative-paths/master.svg?label=windows\n\n[coverage-url]: https://codecov.io/gh/tunnckoCore/clean-stacktrace-relative-paths\n[coverage-img]: https://img.shields.io/codecov/c/github/tunnckoCore/clean-stacktrace-relative-paths/master.svg\n\n[david-url]: https://david-dm.org/tunnckoCore/clean-stacktrace-relative-paths\n[david-img]: https://img.shields.io/david/tunnckoCore/clean-stacktrace-relative-paths.svg\n\n[standard-url]: https://github.com/feross/standard\n[standard-img]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n\n[paypalme-url]: https://www.paypal.me/tunnckoCore\n[paypalme-img]: https://img.shields.io/badge/paypal-donate-brightgreen.svg\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fclean-stacktrace-relative-paths","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftunnckocore%2Fclean-stacktrace-relative-paths","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftunnckocore%2Fclean-stacktrace-relative-paths/lists"}