# prepare-stack-trace

> Error.prepareStackTrace ponyfill for Node. Made for Cabin.

Latest version **0.0.4** (published 2019-09-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install prepare-stack-trace
pnpm add prepare-stack-trace
yarn add prepare-stack-trace
bun add prepare-stack-trace
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2019-09-18 |
| First published | 2019-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=6.4.0 |
| Dependencies | 0 |
| Unpacked size | 9.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Nick Baugh |
| Maintainers | niftylettuce |
| Keywords | cabin, error, fallback, logger, node, polyfill, ponyfill, prepare, prepareStackTrace, stack, trace |

## Links

- npm: https://www.npmjs.com/package/prepare-stack-trace
- Repository: https://github.com/cabinjs/prepare-stack-trace
- Issues: https://github.com/cabinjs/prepare-stack-trace/issues
- npm.io page: https://npm.io/package/prepare-stack-trace

## 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
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 0.0.4 (latest) — 2019-09-18
- 0.0.3 — 2019-09-13
- 0.0.2 — 2019-09-13
- 0.0.1 — 2019-09-13

## README

# prepare-stack-trace

[![build status](https://img.shields.io/travis/cabinjs/prepare-stack-trace.svg)](https://travis-ci.org/cabinjs/prepare-stack-trace)
[![code coverage](https://img.shields.io/codecov/c/github/cabinjs/prepare-stack-trace.svg)](https://codecov.io/gh/cabinjs/prepare-stack-trace)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/cabinjs/prepare-stack-trace.svg)](LICENSE)

> `Error.prepareStackTrace` ponyfill for Node.  Made for [Cabin][].


## Table of Contents

* [Install](#install)
* [Usage](#usage)
  * [Node](#node)
  * [VanillaJS](#vanillajs)
* [Contributors](#contributors)
* [License](#license)


## Install

[npm][]:

```sh
npm install prepare-stack-trace
```

[yarn][]:

```sh
yarn add prepare-stack-trace
```


## Usage

### Node

```js
const StackFrame = require('stackframe');
const ErrorStackParser = require('error-stack-parser');
const prepareStackTrace = require('prepare-stack-trace');

const err1 = new Error('Oops!');
const err2 = new Error('Error 1 will inherit this stack trace');
err1.stack = prepareStackTrace(err1, ErrorStackParser.parse(err2));

console.log('err1', err1);
console.log('err2', err2);
```

### VanillaJS

```html
<script src="https://unpkg.com/stackframe"></script>
<script src="https://unpkg.com/error-stack-parser"></script>
<script src="https://unpkg.com/prepare-stack-trace"></script>
<script type="text/javascript">
  (function() {
    var err1 = new Error('Oops!');
    var err2 = new Error('Error 1 will inherit this stack trace');
    err1.stack = prepareStackTrace(err1, ErrorStackParser.parse(err2));

    console.log('err1', err1);
    console.log('err2', err2);
  })();
</script>
```


## Contributors

| Name           | Website                    |
| -------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |


## License

[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)


## 

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[cabin]: https://cabinjs.com

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