# is-bluebird

> Is this a bluebird promise I see before me?

Latest version **1.0.2** (published 2016-09-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-bluebird
pnpm add is-bluebird
yarn add is-bluebird
bun add is-bluebird
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-09-03 |
| First published | 2016-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Overlook Motel |
| Maintainers | overlookmotel |
| Keywords | bluebird, promise, is, instance, constructor, version, then, check, test |

## Links

- npm: https://www.npmjs.com/package/is-bluebird
- Repository: https://github.com/overlookmotel/is-bluebird
- Homepage: https://github.com/overlookmotel/is-bluebird#readme
- Issues: https://github.com/overlookmotel/is-bluebird/issues
- npm.io page: https://npm.io/package/is-bluebird

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-09-03
- 1.0.1 — 2016-06-18
- 1.0.0 — 2016-06-18

## README

# is-bluebird.js

# Is this a bluebird promise I see before me?

[![NPM version](https://img.shields.io/npm/v/is-bluebird.svg)](https://www.npmjs.com/package/is-bluebird)
[![Build Status](https://img.shields.io/travis/overlookmotel/is-bluebird/master.svg)](http://travis-ci.org/overlookmotel/is-bluebird)
[![Dependency Status](https://img.shields.io/david/overlookmotel/is-bluebird.svg)](https://david-dm.org/overlookmotel/is-bluebird)
[![Dev dependency Status](https://img.shields.io/david/dev/overlookmotel/is-bluebird.svg)](https://david-dm.org/overlookmotel/is-bluebird)
[![Coverage Status](https://img.shields.io/coveralls/overlookmotel/is-bluebird/master.svg)](https://coveralls.io/r/overlookmotel/is-bluebird)

## Usage

Tools to check whether some input is a [bluebird](http://bluebirdjs.com/) 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.

```js
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.

```js
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.

```js
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.

```js
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](https://github.com/overlookmotel/is-bluebird/blob/master/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

---
_Source: https://npm.io/package/is-bluebird · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
