stacktracify
Advanced tools
+26
-18
@@ -11,21 +11,21 @@ #!/usr/bin/env node | ||
| const cli = meow(` | ||
| Usage | ||
| $ stacktracify <map-path> | ||
| Usage | ||
| $ stacktracify <map-path> | ||
| Options | ||
| Options | ||
| --file, -f (default is read from clipboard) | ||
| Examples | ||
| $ stacktracify /path/to/js.map --file /path/to/my-stacktrace.txt | ||
| Examples | ||
| $ stacktracify /path/to/js.map --file /path/to/my-stacktrace.txt | ||
| `, { | ||
| flags: { | ||
| file: { | ||
| type: 'string', | ||
| alias: 'f', | ||
| } | ||
| } | ||
| flags: { | ||
| file: { | ||
| type: 'string', | ||
| alias: 'f', | ||
| }, | ||
| }, | ||
| }); | ||
| const file = cli.flags.file; | ||
| const { file } = cli.flags; | ||
@@ -53,9 +53,17 @@ (async () => { | ||
| stack.forEach(({ lineNumber, column }) => { | ||
| const pos = smc.originalPositionFor({ line: lineNumber, column }); | ||
| if (pos && pos.line != null) { | ||
| console.log(` at ${pos.name || ''} (${pos.source}:${pos.line}:${pos.column})`); | ||
| stack.forEach(({ methodName, lineNumber, column }) => { | ||
| try { | ||
| if (lineNumber == null || lineNumber < 1) { | ||
| console.log(` at ${methodName || ''}`); | ||
| } else { | ||
| const pos = smc.originalPositionFor({ line: lineNumber, column }); | ||
| if (pos && pos.line != null) { | ||
| console.log(` at ${pos.name || ''} (${pos.source}:${pos.line}:${pos.column})`); | ||
| } | ||
| // console.log('src', smc.sourceContentFor(pos.source)); | ||
| } | ||
| } catch (err) { | ||
| console.log(` at FAILED_TO_PARSE_LINE`); | ||
| } | ||
| // console.log('src', smc.sourceContentFor(pos.source)); | ||
| }); | ||
@@ -62,0 +70,0 @@ } catch (err) { |
+1
-1
| { | ||
| "name": "stacktracify", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "Make unreadable production stacktraces readable using source maps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+2
-1
@@ -45,2 +45,3 @@ # stacktracify | ||
| - https://github.com/gabmontes/source-map-cli (only takes one line at a time) | ||
| - https://github.com/gabmontes/source-map-cli (only takes one line at a time) | ||
| - https://github.com/janekp/mapstrace (not a CLI, not easy to use for any stack trace) |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
4622
8.65%59
15.69%47
4.44%