# lie

> A basic but performant promise implementation

Latest version **3.3.0** (published 2018-03-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install lie
pnpm add lie
yarn add lie
bun add lie
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.3.0 |
| Published | 2018-03-06 |
| First published | 2013-08-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 57.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 741 |
| Maintainers | cwmma |
| Keywords | lie, promise, async, aplus |

## Links

- npm: https://www.npmjs.com/package/lie
- Repository: https://github.com/calvinmetcalf/lie
- Homepage: https://github.com/calvinmetcalf/lie#readme
- Issues: https://github.com/calvinmetcalf/lie/issues
- npm.io page: https://npm.io/package/lie

## Dependencies (1)

- [immediate](https://npm.io/package/immediate.md) ~3.0.5

## 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

- 3.3.0 (latest) — 2018-03-06
- 3.2.0 — 2018-01-29
- 3.1.1 — 2017-02-09
- 3.1.0 — 2016-07-27
- 3.0.4 — 2016-04-30
- 3.0.3 — 2016-04-30
- 3.0.2 — 2016-01-21
- 3.0.1 — 2015-08-06
- 3.0.0 — 2015-07-30
- 2.9.1 — 2015-05-27
- 2.9.0 — 2015-05-26
- 2.8.1 — 2015-01-07
- 2.8.0 — 2014-09-19
- 2.7.7 — 2014-07-01
- 2.7.6 — 2014-06-04
- … 32 more at https://npm.io/package/lie/versions

## README

# lie
<a href="http://promises-aplus.github.com/promises-spec">
  <img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png"
       alt="Promises/A+ logo" title="Promises/A+ 1.1 compliant" align="right" />
</a> [![Build Status](https://travis-ci.org/calvinmetcalf/lie.svg)](https://travis-ci.org/calvinmetcalf/lie)

lie is a small, performant promise library implementing the [Promises/A+ spec](http://promises-aplus.github.com/promises-spec/) (Version 1.1).

Originally a fork of [Ruben Verborgh](https://github.com/RubenVerborgh)'s [promiscuous](https://github.com/RubenVerborgh/promiscuous), with version 2.6 it became a fork of [ayepromise](https://github.com/cburgmer/ayepromise) by [Chris Burgmer](https://github.com/cburgmer).

```bash
npm install lie

```

```javascript
var Promise = require('lie');
// or use the pollyfill
require('lie/polyfill');
```

## Usage

Either use it with [browserify](http://browserify.org/) (recommended) or grab one of the files from the dist folder:

- lie.js/lie.min.js exposes 'Promise' either as a UMD module or from the global scope, depending on if a CJS or AMD loader is available.
- lie.polyfill.js/lie.polyfill.min.js adds 'Promise' to the global scope only if it's not already defined (not a UMD).

## API

Implements the standard ES6 api:

```js
new Promise(function(resolve, reject){
    doSomething(function(err, result) {
        if (err) {
            reject(err);
        } else {
            resolve(result);
        }
    });
}).then(function (value) {
    //on success
}, function (reason) {
    //on error
}).catch(function (reason) {
    //shortcut for error handling
});

Promise.all([
    //array of promises or values
]).then(function ([/* array of results */]));

Promise.race([
    //array of promises or values
]);
// either resolves or rejects depending on the first value to do so
```

## Unhandled Rejections

In Node.js, lie emits an `unhandledRejection` event when a rejected promise isn't caught, in line with [how io.js does it](https://iojs.org/api/process.html#process_event_unhandledrejection). This allows it to act as a promise shim in both Node.js and the browser.

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