# @fatso83/stacktrace-cli

> Show source-mapped line numbers

Latest version **1.0.7** (published 2022-03-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install @fatso83/stacktrace-cli
pnpm add @fatso83/stacktrace-cli
yarn add @fatso83/stacktrace-cli
bun add @fatso83/stacktrace-cli
```

Provides the command `stacktrace-cli`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2022-03-30 |
| First published | 2019-08-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 139.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | fatso83 |

## Links

- npm: https://www.npmjs.com/package/@fatso83/stacktrace-cli
- Repository: https://github.com/fatso83/stacktrace-cli
- Homepage: https://github.com/fatso83/stacktrace-cli#readme
- Issues: https://github.com/fatso83/stacktrace-cli/issues
- npm.io page: https://npm.io/package/@fatso83/stacktrace-cli

## Dependencies (1)

- [puppeteer](https://npm.io/package/puppeteer.md) ^1.19.0

## Recent versions

- 1.0.7 (latest) — 2022-03-30
- 1.0.6 — 2019-12-02
- 1.0.5 — 2019-11-28
- 1.0.4 — 2019-08-05
- 1.0.3 — 2019-08-05
- 1.0.2 — 2019-08-05
- 1.0.1 — 2019-08-05
- 1.0.0 — 2019-08-05

## README

# stacktrace-cli
> Retroactively show a source mapped location from a error message

## Example:
You have such an error in your logs: 
```
https://localhost:56962/app-bundle.js 129:600036 TypeError: Cannot read property 'map' of undefined
```

If you download `app-bundle.js` and `app-bundle.js.map` you can get the original 
source lines like this:

```
$ npx @fatso83/stacktrace-cli app-bundle.js app-bundle.js.map 129:600036
{
    "columnNumber": 56,
    "lineNumber": 78,
    "fileName": "webpack:///src/store/entities/entities-reducer.js",
    "functionName": "getEntitiesById"
}
{
    "columnNumber": 56,
    "lineNumber": 78,
    "fileName": "webpack:///src/store/entities/entities-reducer.js",
    "functionName": "map"
}
```
`getEntitiesById` is the function the error was thrown. `map` was the symbol that caused it (`undefined` called as function).

## Install
You don't need to install it now that we have `npx` (see example), but you can install it globally if you want to:
```
npm install -g @fatso83/stacktrace-cli
```

You can then call it as `stacktrace-cli` wherever you are.

## How?
- Stacktrace.js
- Node HTTP
- Puppeteer

Stacktrace.js is wonderful. In theory. When trying to use it, the docs are 
missing all the bits on how to get this running. This is my attempt at 
solving [an itch that needed scratching](https://stackoverflow.com/questions/57346131/convert-columnerror-to-original-line-numbers-using-a-source-map).

This was literally hacked together in 3 hours, so feel free to extract, refactor and package it up as the sweet little thing it could have been.

---
_Source: https://npm.io/package/@fatso83/stacktrace-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
