Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/then/is-promise
- Owner: then
- License: mit
- Created: 2012-12-23T16:01:29.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T17:31:49.000Z (over 1 year ago)
- Last Synced: 2024-05-15T14:30:08.007Z (6 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 282
- Watchers: 10
- Forks: 32
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-nodejs - is-promise - Test whether an object looks like a promises-a+ promise. ![](https://img.shields.io/github/stars/then/is-promise.svg?style=social&label=Star) (Repository / Check/Detect)
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