https://github.com/then/is-promise
Test whether an object looks like a promises-a+ promise
https://github.com/then/is-promise
Last synced: 6 months 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 13 years ago)
- Default Branch: master
- Last Pushed: 2023-04-29T17:31:49.000Z (over 2 years ago)
- Last Synced: 2025-04-22T02:01:51.631Z (7 months ago)
- Language: JavaScript
- Size: 25.4 KB
- Stars: 280
- Watchers: 9
- Forks: 31
- 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.  (Repository / Check/Detect)
README
# is-promise
Test whether an object looks like a promises-a+ promise
[](https://app.circleci.com/pipelines/github/then/is-promise)
[](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
