Big update!Introducing GitHub Bot Commands. Learn more →
Socket
Log inBook a demo

p-is-promise

Package Overview
Dependencies
0
Maintainers
1
Versions
6
Issues
File Explorer

Advanced tools

p-is-promise

Check if something is a promise

    4.0.0latest

Version published
Maintainers
1
Weekly downloads
6,264,493
decreased by-9.38%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 de54800
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/p-is-promise/compare/v3.0.0...v4.0.0

Readme

Source

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
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is p-is-promise?

Check if something is a promise

Is p-is-promise popular?

The npm package p-is-promise receives a total of 5,045,884 weekly downloads. As such, p-is-promise popularity was classified as popular.

Is p-is-promise well maintained?

We found that p-is-promise demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 16 Apr 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc