# stacktrace-parser

> Parses every stack trace into a nicely formatted array of hashes.

Latest version **0.1.11** (published 2025-02-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install stacktrace-parser
pnpm add stacktrace-parser
yarn add stacktrace-parser
bun add stacktrace-parser
```

## Health

**Score 55/100 (C)** — status: stable.

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

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.1.11 |
| Published | 2025-02-18 |
| First published | 2014-02-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6 |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 118 |
| Author | Georg Tavonius |
| Maintainers | calamari |
| Keywords | errors, stacktrace, parser, exceptions |

## Links

- npm: https://www.npmjs.com/package/stacktrace-parser
- Repository: https://github.com/errwischt/stacktrace-parser
- Issues: http://github.com/errwischt/stacktrace-parser/issues
- npm.io page: https://npm.io/package/stacktrace-parser

## Dependencies (1)

- [type-fest](https://npm.io/package/type-fest.md) ^0.7.1

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.11 (latest) — 2025-02-18
- 0.1.10 — 2020-05-07
- 0.1.9 — 2020-02-21
- 0.1.8 — 2019-11-28
- 0.1.7 — 2019-09-12
- 0.1.6 — 2019-04-29
- 0.1.5 — 2019-04-05
- 0.1.4 — 2016-07-07
- 0.1.3 — 2015-08-19
- 0.1.2 — 2015-07-29
- 0.1.1 — 2014-02-07

## README

[![Build Status][build-image]][build-url] [![dependencies][deps-image]][deps-url] [![dev-dependencies][dev-deps-image]][dev-deps-url]

# StackTrace-Parser

This parser parses a stack trace from any browser or Node.js and returns an array of hashes each representing a line.

The goal here is to support every browser even old Internet Explorer stack traces will work.

## Install

```bashv0.1
npm install stacktrace-parser
```

## Usage

```JavaScript
import * as stackTraceParser from 'stacktrace-parser';

try {
  throw new Error('My error');
} catch(ex) {
  const stack = stackTraceParser.parse(ex.stack);
}
```

Every line contains five properties: `lineNumber`, `methodName`, `arguments`, `file` and `column` (if applicable).

## TODOs

- parse stack traces from other sources (Ruby, etc) (v0.3)

## Contribution

If you want to contrib, then do you thing, write tests, run `npm run test` ensure that everything is green,
commit and make the pull request. Or just write an issue, or let's talk.

## Contributors

- [Georg Tavonius](https://github.com/calamari)
- [James Ide](https://github.com/ide)
- [Alexander Kotliarskyi](https://github.com/frantic)
- [Dimitri Benin](https://github.com/BendingBender)
- [Tony Brix](https://github.com/UziTech)

## LICENSE

[The MIT License (MIT)](https://github.com/errwischt/stacktrace-parser/blob/master/LICENSE)

[build-image]: https://img.shields.io/travis/errwischt/stacktrace-parser/master.svg?style=flat-square
[build-url]: https://travis-ci.org/errwischt/stacktrace-parser
[deps-image]: https://img.shields.io/david/errwischt/stacktrace-parser.svg?style=flat-square
[deps-url]: https://david-dm.org/errwischt/stacktrace-parser
[dev-deps-image]: https://img.shields.io/david/dev/errwischt/stacktrace-parser.svg?style=flat-square
[dev-deps-url]: https://david-dm.org/errwischt/stacktrace-parser?type=dev

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