Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

p-is-promise

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

p-is-promise

Check if something is a promise

  • 4.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.6M
decreased by-10.45%
Maintainers
1
Weekly downloads
 
Created

What is p-is-promise?

The p-is-promise npm package is a simple utility that allows you to check if a value is a Promise. This can be particularly useful when dealing with asynchronous operations in JavaScript, where you might need to differentiate between promises and other types of values.

What are p-is-promise's main functionalities?

Check if a value is a Promise

This feature allows you to easily determine whether a given value is a Promise. It's useful for conditional logic where the handling of a value depends on whether it's asynchronous (a Promise) or synchronous.

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

console.log(pIsPromise(Promise.resolve())); // true
console.log(pIsPromise('not a promise')); // false

Other packages similar to p-is-promise

Keywords

FAQs

Package last updated on 16 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc