# @fizzygalacticus/is-promise

> Help determine if a value is a Promise.

Latest version **1.0.1** (published 2019-08-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @fizzygalacticus/is-promise
pnpm add @fizzygalacticus/is-promise
yarn add @fizzygalacticus/is-promise
bun add @fizzygalacticus/is-promise
```

## 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.1 |
| Published | 2019-08-28 |
| First published | 2019-08-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dustin L. Dodson |
| Maintainers | fizzygalacticus |
| Keywords | is, promise, determine, if |

## Links

- npm: https://www.npmjs.com/package/@fizzygalacticus/is-promise
- Repository: https://github.com/FizzyGalacticus/is-promise
- npm.io page: https://npm.io/package/@fizzygalacticus/is-promise

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2019-08-28
- 1.0.0 — 2019-08-28

## README

# is-promise

Helps determine if a value is a Promise.

## Installation

`yarn add @fizzygalacticus/is-promise` || `npm i @fizzygalacticus/is-promise`

## Usage

`is-promise` returns an object with two values: `promise` and `uncertainty`. `promise` will be true if there is a great chance that the value being tested is a promise. `uncertainty` will be true if there is any uncertainty about whether or not the value is a promise.

```js
const isPromise = require('@fizzygalacticus/is-promise');

const Q = require('q');
const Bluebird = require('bluebird');
const RSVP = require('rsvp');
const FakePromise = require('promise');

const results = isPromise(new Promise(resolve => resolve())); // { promise: true, uncertainty: false }
const results = isPromise(new Q(resolve => resolve())); // { promise: true, uncertainty: true }
const results = isPromise(new Bluebird(resolve => resolve())); // { promise: true, uncertainty: true }
const results = isPromise(new FakePromise(resolve => resolve())); // { promise: true, uncertainty: true }
const results = isPromise(new RSVP.Promise(resolve => resolve())); // { promise: true, uncertainty: true }
```

## Notes

In order to be 100% certain that an object is a promise, you should stick to using native Node promises.

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