Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/then/is-promise

Test whether an object looks like a promises-a+ promise
https://github.com/then/is-promise

Last synced: 14 days ago
JSON representation

Test whether an object looks like a promises-a+ promise

Awesome Lists containing this project

README

        

# is-promise

Test whether an object looks like a promises-a+ promise

[![Build Status](https://img.shields.io/circleci/build/github/then/is-promise/master?style=for-the-badge)](https://app.circleci.com/pipelines/github/then/is-promise)
[![NPM version](https://img.shields.io/npm/v/is-promise.svg?style=for-the-badge)](https://www.npmjs.org/package/is-promise)

## Installation

$ npm install is-promise

You can also use it client side via npm.

## API

```typescript
import isPromise from 'is-promise';

isPromise(Promise.resolve());//=>true
isPromise({then:function () {...}});//=>true
isPromise(null);//=>false
isPromise({});//=>false
isPromise({then: true})//=>false
```

## License

MIT