evanw / evanw/node-source-map-support
Use sourcemap inside of code executed by eval()
Open
- Dominant language
- JavaScript
- Stars
- 2.2k
- Forks
- 223
- PR merge metrics
- No merged PRs in 30d
Description
Currently, I use **esbuild** to compile code and dynamically transpile and execute user JS using `eval()`, like this:
```js
try {
if (code) {
code = `(function(exports) {
${code}
return exports;
})({})`
mod = eval(code)
}
} catch (err) {
console.error('Exception:', err)
}
```
The code contains a sourcemap.
Is there a way to use node-source-map-support to print the exception's stack using the sourcemap info?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.