node/deps/npm/node_modules/p-is-promise
Michael Perrotte 54c1a09202 deps: upgrade npm to 6.13.7
PR-URL: https://github.com/nodejs/node/pull/31558
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-01-31 18:52:20 -08:00
..
index.d.ts deps: upgrade npm to 6.13.7 2020-01-31 18:52:20 -08:00
index.js deps: upgrade npm to 6.13.7 2020-01-31 18:52:20 -08:00
license deps: upgrade npm to 6.13.7 2020-01-31 18:52:20 -08:00
package.json deps: upgrade npm to 6.13.7 2020-01-31 18:52:20 -08:00
readme.md deps: upgrade npm to 6.13.7 2020-01-31 18:52:20 -08:00

readme.md

p-is-promise Build Status

Check if something is a promise

Why not is-promise? That module checks for a thenable, 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

const pIsPromise = require('p-is-promise');
const Bluebird = require('bluebird');

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

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

pIsPromise('🦄');
//=> false

License

MIT © Sindre Sorhus