# i-promise

> Returns an available ES6 Promise implementation, browserify friendly.

Latest version **1.1.0** (published 2015-02-10) · ISC license · 0 weekly downloads

## Install

```sh
npm install i-promise
pnpm add i-promise
yarn add i-promise
bun add i-promise
```

## 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.1.0 |
| Published | 2015-02-10 |
| First published | 2014-11-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Michael J. Ryan |
| Maintainers | tracker1 |
| Keywords | es6, promise, async, flow-control |

## Links

- npm: https://www.npmjs.com/package/i-promise
- Repository: https://github.com/tracker1/i-promise
- Issues: https://github.com/tracker1/i-promise/issues
- npm.io page: https://npm.io/package/i-promise

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2015-02-10
- 1.0.5 — 2014-11-22

## README

i-promise
=========

When calling this module a [Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) library will be returned if one is available.

This module will not declare any dependencies, you should install a fallback library downstream if needed.

## Install

`npm install --save i-promise`

## Use

```
var Promise = require('i-promise');
if (!Promise) throw new Error('No ES6 Promise Library Available.');

return Promise.resolve('success')
```

## Notes

In a browser (via browserify), it will return either `window.Promise`, `window.Q.Promise` or `window.Q.promise` in that order, you should have an [es6-promise shim](https://github.com/paulmillr/es6-shim/) or the [Q library](https://github.com/kriskowal/q) loaded globally in the browser if you need promises in older browsers.

In node, attempts to use the following will be made.

* native `Promise` (newer versions of node.js)
* [es6-promise](https://www.npmjs.org/package/es6-promise)
* [es6-promises](https://www.npmjs.org/package/es6-promises)
* [bluebird](https://www.npmjs.org/package/bluebird)
* [q](https://www.npmjs.org/package/q) (`Promise` then `promise`)

## Preferring user implementation over native

Default behavior is to always favor native implementation if found. You can still favor the implementation of your choice without overriding global `Promise`:

```js
require('i-promise/config').use(MyPromiseImplementation);
```

You must run this code **before** any call to `require('i-promise')`.

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