4.0.0 • Published 3 years ago

p-is-promise v4.0.0

Weekly downloads
12,649,963
License
MIT
Repository
github
Last release
3 years ago

p-is-promise

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

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

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

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

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

Related


archetype-librarykilli8n-react-native-fast-image@cashremit/cr-streamline-icons@l1nyanm1ng/react-picture-viewerrn-pdf-reader-offlinedyx-reacttalent-to-vite-cli@mink-opn/build-tokensreact-native-slider-kfunblock-block-save-variables@everything-registry/sub-chunk-2396@itoa/fields-content@itoa/utils@rabailriaz/hisaab-web-portalweb-yii2web-elements-iconswebchexys_cliyangzai-clivue-v3-yandex-metrikavue-compmentspigot-ui-inventoryteapackage-tatespoorman297techfox-icontechfox-react-feathertest-carosello-campustestnpm_lmnsuperset-plugin-chart-hello-world2twine-libtwine-libraryvalidar@koikorn/utils@koikorn/field-contentetheral-cli@kalkanisys/vue-select@levlevin/react-portal-tooltipfastlion-picture-viewer@ladjs/gracefuldrift-npm@innoswap/core@innodata/vue-v3-ya-metrika@infinitebrahmanuniverse/nolb-p-good-trygo-go-trygatsby-source-prismic-stoutlabsgogency-test-2gogency@npm-lt/cli@omni-tools/mem@ocopjs/utils@meerasolution/react-native-ms-upi-paymentfork-react-ffmpeg@minko-fe/lodash-pro@navch/cli-utilsgit-branching-workflow@keystone-alpha/field-content@keystone-alpha/utils@keystone-next/fields-content-legacy@kirrosh/pts@jellywelly/iterare@keystonejs/fields-content@keystonejs/utils@sackmanson/quill-image-uploader@sagacious/sync@opn-ooo/eslint-config-opnguruwayguruway.js@report-toolkit/commoniex-sdkinstall-ishexyun.helpers@poscredit/plugin-chart-boris@hawkingnetwork/react-native-tab-view@inti-ar/evm-chains@iyansr/react-native-image-viewing@jarrydark/editorsimplejs@jretts/modified-sveltejs@promise-utils/anyhapi-render-react@pawjs/tapable@oriduk/ckeditor5-rebuild-musicanote@oriduk/ckeditor5-rebuild-oriduk@rbc-public/react-selectable-fast@faizanhaider/iconsax@ericmcornelius/ease@southcn/ckeditor5-build-inlinejeuxuihela-config-tunnckocore@poondestroyer/sig@tonysusi/vapidng-search-dropdownnavybirdaru@arielapaula/components@arielapaula/testmy-temp-clib2x-utils@batbayar/superset-plugin-chart-hello-world@yplabs-ltd/react-native-detectorls-map-wrap
4.0.0

3 years ago

3.0.0

5 years ago

2.1.0

5 years ago

2.0.0

6 years ago

1.1.0

7 years ago

1.0.0

7 years ago