# @suchipi/error-utils

> utils for parsing error stacks, apply source maps to errors, etc

Latest version **0.2.2** (published 2026-07-03) · MIT license · 78 weekly downloads

## Install

```sh
npm install @suchipi/error-utils
pnpm add @suchipi/error-utils
yarn add @suchipi/error-utils
bun add @suchipi/error-utils
```

## Health

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

Positive: has types; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; no esm support; pre 1.0.

Negative: declining downloads.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2026-07-03 |
| First published | 2024-03-28 |
| Weekly downloads | 78 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 18.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 10 |
| Author | Lily Skye |
| Maintainers | suchipi |
| Keywords | error, stack, parse, sourcemap, source, map |

## Links

- npm: https://www.npmjs.com/package/@suchipi/error-utils
- Repository: https://github.com/suchipi/error-utils
- Homepage: https://github.com/suchipi/error-utils#readme
- Issues: https://github.com/suchipi/error-utils/issues
- npm.io page: https://npm.io/package/@suchipi/error-utils

## Dependencies (3)

- [source-map](https://npm.io/package/source-map.md) ^0.6.1
- [stackframe](https://npm.io/package/stackframe.md) ^1.3.4
- [error-stack-parser](https://npm.io/package/error-stack-parser.md) ^2.1.4

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@vorionsys/shared-constants](https://npm.io/package/@vorionsys/shared-constants.md) — 26 weekly downloads

## Recent versions

- 0.2.2 (latest) — 2026-07-03
- 0.2.1 — 2024-05-23
- 0.2.0 — 2024-03-28
- 0.1.0 — 2024-03-28

## README

# `@suchipi/error-utils`

Node.js utils for parsing error stacks, applying source maps to error stacks, etc

- `ParsedError` class
  - can be constructed from an Error instance
  - stack lines are parsed into a data structure with filename/line/column info
  - can be manipulated and then converted back into a normal Error
  - has a `stack` property getter which makes a V8-style stack string from the parsed stack frames
- `applySourceMapsToParsedError` function
  - updates the line/column numbers on the stack frames of a ParsedError by using source maps
  - returns a new ParsedError
- `applySourceMapsToStackFrame` function
  - same as above but for a single StackFrame
- `getStackFrame` function
  - given a stack offset number, gets a `StackFrame` instance from the current callstack.
  - offset of `0` gives the call to `getStackFrame`.
  - can be used to obtain the file name and (sometimes) function name of the currently-executing file, or one of its callers.
- `isError` function
  - type predicate function
  - returns true for objects with shape `{ name: string, message: string }` when `name` ends with "Error"

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