# errorstacks

> Parse error stack traces

Latest version **2.4.2** (published 2026-05-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install errorstacks
pnpm add errorstacks
yarn add errorstacks
bun add errorstacks
```

## Health

**Score 65/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.4.2 |
| Published | 2026-05-17 |
| First published | 2020-04-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=24 |
| Dependencies | 0 |
| Unpacked size | 31.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 108 |
| Author | Marvin Hagemeister |
| Maintainers | marvinhagemeister |

## Links

- npm: https://www.npmjs.com/package/errorstacks
- Repository: https://github.com/marvinhagemeister/errorstacks
- Homepage: https://github.com/marvinhagemeister/errorstacks#readme
- Issues: https://github.com/marvinhagemeister/errorstacks/issues
- npm.io page: https://npm.io/package/errorstacks

## Recent versions

- 2.4.2 (latest) — 2026-05-17
- 2.4.1 — 2023-11-08
- 2.4.0 — 2022-03-10
- 2.3.2 — 2021-03-30
- 2.3.1 — 2021-03-30
- 2.3.0 — 2021-02-13
- 2.2.0 — 2021-01-04
- 2.1.1 — 2021-01-03
- 2.1.0 — 2021-01-03
- 2.0.0 — 2020-09-17
- 1.3.0 — 2020-07-04
- 1.2.0 — 2020-07-04
- 1.1.5 — 2020-05-16
- 1.1.4 — 2020-04-18
- 1.1.3 — 2020-04-18
- … 4 more at https://npm.io/package/errorstacks/versions

## README

# errorstacks

Simple parser for Error stack traces.

Currently supported browsers/platforms:

- Firefox
- Chrome
- Edge
- Node

## Usage

Install `errorstacks` via your package manager of choice. Here we'll use `npm`.

```bash
npm install errorstacks
```

Example code:

```js
import { parseStackTrace } from 'errorstacks';

function foo() {
  throw new Error('fail');
}

try {
  foo();
} catch (err) {
  const parsed = parseStackTrace(err.stack);
  console.log(parsed);
  // Logs:
  // [
  //   {
  //     line: 4,
  //     column: 8,
  //     type: '',
  //     name: 'foo',
  //     raw: '    at foo (/my-project/foo.ts:4:8)'
  //   },
  // ]
```

_Note: `type` will be the string `"native"` if native code execution was detected._

## License

MIT, see [the license file](./LICENSE)

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