# promises-debugger

> A tool to debug promises

Latest version **1.0.3** (published 2019-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install promises-debugger
pnpm add promises-debugger
yarn add promises-debugger
bun add promises-debugger
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-11-11 |
| First published | 2019-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | markwylde |

## Links

- npm: https://www.npmjs.com/package/promises-debugger
- npm.io page: https://npm.io/package/promises-debugger

## Recent versions

- 1.0.3 (latest) — 2019-11-11
- 1.0.2 — 2019-11-11
- 1.0.1 — 2019-11-11
- 1.0.0 — 2019-11-11

## README

# Promises Debugger

A tool to give meaningful stacktraces for unhandled promise rejections

## Usage
Install the dependency
```
npm i promises-debugger
```

Require it in your main javascript file

```javascript
require('promises-debugger')({
  dimNodeModules: true,
  dimInternalModules: false,
  dimNotInProjectRoot: true,
  removeInternalModules: true
})
```

## Without promises-debugger
```bash
(node:9226) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 127.0.0.1:443
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1126:14)
(node:9226) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:9226) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```

## With promises-debugger
```bash
-------------------------------------------------
 promises-debugger caught an unhandled rejection
-------------------------------------------------
Error: connect ECONNREFUSED 127.0.0.1:443
    at Axios.request (/Users/mark/Documents/promises-debugger/node_modules/axios/lib/core/Axios.js:53:23)
    at Axios.<computed> [as post] (/Users/mark/Documents/promises-debugger/node_modules/axios/lib/core/Axios.js:78:17)
    at Function.wrap [as post] (/Users/mark/Documents/promises-debugger/node_modules/axios/lib/helpers/bind.js:9:15)
    at sayHello (/Users/mark/Documents/promises-debugger/test/index.js:15:15)
    at main (/Users/mark/Documents/promises-debugger/test/index.js:23:9)Error
    at main (/Users/mark/Documents/promises-debugger/test/index.js:21:9)
    at Object.<anonymous> (/Users/mark/Documents/promises-debugger/test/index.js:27:1)
-------------------------------------------
```

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