Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/unjs/errx
Zero dependency library to capture and parse stack traces in Node, Bun, Deno and more.
https://github.com/unjs/errx
error stack-trace
Last synced: 4 months ago
JSON representation
Zero dependency library to capture and parse stack traces in Node, Bun, Deno and more.
- Host: GitHub
- URL: https://github.com/unjs/errx
- Owner: unjs
- License: mit
- Created: 2024-07-04T10:39:49.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-02T12:04:00.000Z (4 months ago)
- Last Synced: 2024-09-05T00:38:02.833Z (4 months ago)
- Topics: error, stack-trace
- Language: TypeScript
- Homepage:
- Size: 164 KB
- Stars: 78
- Watchers: 2
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Code of conduct: CODE_OF_CONDUCT.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# errx
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Github Actions][github-actions-src]][github-actions-href]
[![Codecov][codecov-src]][codecov-href]> Zero dependency library to capture and parse stack traces in Node, Bun, Deno and more.
## Usage
Install package:
```sh
# npm
npm install errx# pnpm
pnpm install errx
``````js
import { captureRawStackTrace, captureStackTrace, parseRawStackTrace } from 'errx'// returns raw string stack trace
captureRawStackTrace()
// returns parsed stack trace
captureStackTrace()console.log(captureStackTrace())
// [{
// function: undefined,
// source: 'file:///code/unjs/errx/playground/index.js',
// line: '5',
// column: '13'
// }]
```## 💻 Development
- Clone this repository
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run interactive tests using `pnpm dev`## License
Made with ❤️
Published under [MIT License](./LICENCE).
[npm-version-src]: https://img.shields.io/npm/v/errx?style=flat-square
[npm-version-href]: https://npmjs.com/package/errx
[npm-downloads-src]: https://img.shields.io/npm/dm/errx?style=flat-square
[npm-downloads-href]: https://npmjs.com/package/errx
[github-actions-src]: https://img.shields.io/github/actions/workflow/status/unjs/errx/ci.yml?branch=main&style=flat-square
[github-actions-href]: https://github.com/unjs/errx/actions?query=workflow%3Aci
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/errx/main?style=flat-square
[codecov-href]: https://codecov.io/gh/unjs/errx