2.0.7 • Published 2 months ago

inspect-promise v2.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Inspect Promise

A reimplementation of Node's util.getPromiseDetails(), which was removed in v16.

!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.

npm i inspect-promise

Usage

There are two ways you can use this package:

  1. Import normally as a function
import { inspectPromise } from "inspect-promise";

const p = Promise.resolve(100);

console.log(inspectPromise(p));
  1. Globally modify the Promise constructor
import "inspect-promise/extend";

const p = Promise.resolve(100);

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

Both result in the same output:

{
  status: "fulfilled",
  value: 100
}
2.0.5

2 months ago

2.0.4

2 months ago

2.0.7

2 months ago

2.0.6

2 months ago

2.0.3

2 months ago

2.0.2

2 months ago

2.0.1

12 months ago

2.0.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago