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

is-bluebird

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-bluebird

Is this a bluebird promise I see before me?

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
219K
decreased by-21.03%
Maintainers
1
Weekly downloads
 
Created
Source

is-bluebird.js

Is this a bluebird promise I see before me?

NPM version Build Status Dependency Status Dev dependency Status Coverage Status

Usage

Tools to check whether some input is a bluebird promise, a bluebird promise constructor, or determining the version of bluebird from a promise or constructor.

isBluebird( promise )

Returns true if is a bluebird promise, false if not.

var isBluebird = require('is-bluebird');
var Bluebird = require('bluebird');

console.log( isBluebird( Bluebird.resolve() ) ); // true
console.log( isBluebird( Promise.resolve() ) ); // false (native JS promise)
isBluebird.ctor( Promise )

Returns true if is bluebird promise constructor, false if not.

var isBluebird = require('is-bluebird');
var Bluebird = require('bluebird');

console.log( isBluebird.ctor( Bluebird ) ); // true
console.log( isBluebird.ctor( Promise ) ); // false (native JS promise)
isBluebird.v2( promise ) / isBluebird.v3( promise )

Returns true if is a bluebird promise of the specified version.

var isBluebird = require('is-bluebird');
var Bluebird2 = require('bluebird2');
var Bluebird3 = require('bluebird3');

console.log( isBluebird.v2( Bluebird2.resolve() ) ); // true
console.log( isBluebird.v2( Bluebird3.resolve() ) ); // false
console.log( isBluebird.v2( Promise.resolve() ) ); // false (native JS promise)
isBluebird.v2.ctor( Promise ) / isBluebird.v3.ctor( Promise )

Returns true if is bluebird promise constructor of the specified version.

var isBluebird = require('is-bluebird');
var Bluebird2 = require('bluebird2');
var Bluebird3 = require('bluebird3');

console.log( isBluebird.v2.ctor( Bluebird2 ) ); // true
console.log( isBluebird.v2.ctor( Bluebird3 ) ); // false
console.log( isBluebird.v2.ctor( Promise ) ); // false (native JS promise)

Tests

Use npm test to run the tests. Use npm run cover to check coverage.

Changelog

See changelog.md

Issues

If you discover a bug, please raise an issue on Github. https://github.com/overlookmotel/is-bluebird/issues

Contribution

Pull requests are very welcome. Please:

  • ensure all tests pass before submitting PR
  • add an entry to changelog
  • add tests for new features
  • document new functionality/API additions in README

Keywords

FAQs

Package last updated on 03 Sep 2016

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