# mini-defer

> Tiny module for creating a deferred with no polyfilling

Latest version **0.0.5** (published 2016-02-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install mini-defer
pnpm add mini-defer
yarn add mini-defer
bun add mini-defer
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2016-02-29 |
| First published | 2016-02-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Sam Gluck |
| Maintainers | sdgluck |
| Keywords | tiny, mini, defer, deferred, promise |

## Links

- npm: https://www.npmjs.com/package/mini-defer
- Repository: https://github.com/sdgluck/mini-defer
- Homepage: https://github.com/sdgluck/mini-defer#readme
- Issues: https://github.com/sdgluck/mini-defer/issues
- npm.io page: https://npm.io/package/mini-defer

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 0.0.5 (latest) — 2016-02-29
- 0.0.4 — 2016-02-29
- 0.0.3 — 2016-02-29
- 0.0.2 — 2016-02-29
- 0.0.1 — 2016-02-29

## README

# mini-defer

> Tiny module for creating a deferred with no polyfilling

Made with ❤ at [@outlandish](http://www.twitter.com/outlandish)

<a href="http://badge.fury.io/js/serialise-response"><img alt="npm version" src="https://badge.fury.io/js/serialise-response.svg"></a>
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)

## Install

    npm install mini-defer --save

__ES6 Import (w/ Babel)__

    import defer from 'mini-defer'

__CommonJS Require__

    var defer = require('mini-defer')

__Script__

    <script src="/node_modules/mini-defer/index.js"></script>
    typeof window.miniDefer //=> "Function"

## Usage

`defer() : Object`

Create a deferred.

## Example

    function operation ()
      const deferred = defer()
      const eventBasedOperation = doOperation()

      eventBasedOperation.onsuccess = deferred.resolve
      eventBasedOperation.onerror = deferred.reject

      return deferred.promise
    }

## Contributing

All pull requests and issues welcome!

If you're not sure how, check out Kent C. Dodds' [great video tutorials on egghead.io](https://egghead.io/lessons/javascript-identifying-how-to-contribute-to-an-open-source-project-on-github)!

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