# inspect-promise

> Reimplements Node's `util.getPromiseDetails()`

Latest version **2.0.7** (published 2024-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install inspect-promise
pnpm add inspect-promise
yarn add inspect-promise
bun add inspect-promise
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.7 |
| Published | 2024-03-06 |
| First published | 2021-10-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 2 |
| Author | Oscar Lee-Vermeren |
| Maintainers | xibread |
| Keywords | promise, inspect, util, sync, async, await, node, node-gyp |

## Links

- npm: https://www.npmjs.com/package/inspect-promise
- Repository: https://github.com/xiBread/inspect-promise
- Homepage: https://github.com/xiBread/inspect-promise#readme
- Issues: https://github.com/xiBread/inspect-promise/issues
- npm.io page: https://npm.io/package/inspect-promise

## Dependencies (1)

- [@mapbox/node-pre-gyp](https://npm.io/package/@mapbox/node-pre-gyp.md) ^1.0.11

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 2.0.7 (latest) — 2024-03-06
- 2.0.6 — 2024-03-06
- 2.0.5 — 2024-03-06
- 2.0.4 — 2024-03-06
- 2.0.3 — 2024-03-05
- 2.0.2 — 2024-03-05
- 2.0.1 — 2023-05-26
- 2.0.0 — 2021-12-24
- 1.0.1 — 2021-10-15
- 1.0.0 — 2021-10-14

## README

<!-- markdownlint-disable MD029 -->

# Inspect Promise

A reimplementation of Node's `util.getPromiseDetails()`, which was removed in [v16](https://github.com/nodejs/node/pull/37819).

> [!NOTE]
> This package is not recommended for use in production other than for reflection purposes. For more information about this topic, please see [nodejs/node#40054](https://github.com/nodejs/node/issues/40054).

```sh
npm i inspect-promise
```

## Usage

There are two ways you can use this package:

1. Import normally as a function

```ts
import { inspectPromise } from "inspect-promise";

const p = Promise.resolve(100);

console.log(inspectPromise(p));
```

2. Globally modify the Promise constructor

```ts
import "inspect-promise/extend";

const p = Promise.resolve(100);

console.log(Promise.inspect(p));
```

Both result in the same output:

```js
{
  status: "fulfilled",
  value: 100
}
```

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