https://github.com/seebigs/stack-remap
https://github.com/seebigs/stack-remap
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/seebigs/stack-remap
- Owner: seebigs
- Created: 2017-02-27T15:22:27.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-27T16:09:02.000Z (over 9 years ago)
- Last Synced: 2025-02-28T19:13:17.451Z (over 1 year ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# stack-remap
**Remap the stacktrace on Errors to point to the src files of your choosing**
## Install
```
$ npm install stack-remap
```
## Use
```js
var stackRemap = require('stack-remap');
// override prepareStackTrace
stackRemap.install();
// setup your mappings
stackRemap.add([
{
source: '/path/to/my/src/one.js',
original: { line: 1, column: 0 },
generated: { line: 5, column: 0 },
totalLines: 80
},
{
source: '/path/to/my/src/two.js',
original: { line: 1, column: 0 },
generated: { line: 85, column: 0 },
totalLines: 120
}
]);
// run your code and see the stack
console.log(new Error('foo'));
// reset mappings if desired
stackRemap.reset();
// stop overriding prepareStackTrace
stackRemap.uninstall();
// everything is back to normal
console.log(new Error('foo'));
```