# p-is-promise

> Check if something is a promise

Latest version **4.0.0** (published 2021-04-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install p-is-promise
pnpm add p-is-promise
yarn add p-is-promise
bun add p-is-promise
```

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2021-04-16 |
| First published | 2016-11-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/p-is-promise) |
| Module format | ESM |
| Node | >=12 |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | promise, is, detect, check, kind, type, thenable, es2015, async, await, promises, bluebird |

## Links

- npm: https://www.npmjs.com/package/p-is-promise
- Repository: https://github.com/sindresorhus/p-is-promise
- Homepage: https://github.com/sindresorhus/p-is-promise#readme
- Issues: https://github.com/sindresorhus/p-is-promise/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/p-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

- 4.0.0 (latest) — 2021-04-16
- 3.0.0 — 2019-07-01
- 2.1.0 — 2019-04-06
- 2.0.0 — 2018-09-24
- 1.1.0 — 2016-11-28
- 1.0.0 — 2016-11-26

## README

# p-is-promise

> Check if something is a promise

Why not [`is-promise`](https://github.com/then/is-promise)? That module [checks for a thenable](https://github.com/then/is-promise/issues/6), not an ES2015 promise. This one is stricter.

You most likely don't need this. Just pass your value to `Promise.resolve()` and let it handle it.

Can be useful if you need to create a fast path for a synchronous operation.

## Install

```
$ npm install p-is-promise
```

## Usage

```js
import isPromise from 'p-is-promise';
import Bluebird from 'bluebird';

isPromise(Promise.resolve('🦄'));
//=> true

isPromise(Bluebird.resolve('🦄'));
//=> true

isPromise('🦄');
//=> false
```

## Related

- [is](https://github.com/sindresorhus/is) - Type check values
- [More…](https://github.com/sindresorhus/promise-fun)

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-p-is-promise?utm_source=npm-p-is-promise&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>

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