# pinky

> Sweetly small promises/a+ implementation.

Latest version **1.0.0** (published 2014-09-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2014-09-26 |
| First published | 2013-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Quildreen "Sorella" Motta |
| Maintainers | killdream |

## Links

- npm: https://www.npmjs.com/package/pinky
- Repository: https://github.com/robotlolita/pinky
- Issues: https://github.com/robotlolita/pinky/issues
- npm.io page: https://npm.io/package/pinky

## Recent versions

- 1.0.0 (latest) — 2014-09-26
- 0.1.3 — 2013-06-30
- 0.1.2 — 2013-03-30
- 0.1.1 — 2013-03-30
- 0.1.0 — 2013-03-30

## README

Pinky
=====

[![Build Status](https://travis-ci.org/robotlolita/pinky.png?branch=master)](https://travis-ci.org/robotlolita/pinky)
![Dependencies Status](https://david-dm.org/robotlolita/pinky.png)

> **Note:** I'm not maintaining this library anymore, since Promises/A+ are broken for me. I recommend using [monadic promises](https://github.com/folktale/data.future) and [monad combinators](https://github.com/folktale/control.monads) instead.

Sweetly small promises/a+ implementation.


## Platform support

Should work fine in ES3.


## Example

```js
var pinky = require('pinky')

var eventual = pinky()
var eventual2 = eventual.then( function(a){ return a + 1 }
                             , function(a){ return a - 1 })

eventual.fulfill(10)
eventual2.then( console.log.bind(console, 'ok:')
              , console.log.bind(console, 'failed:'))
// => ok: 11
```


## Installing

Just grab it from NPM:

    $ npm install pinky
    
    
## Tests

Tests only run on Node right now, so just:

    $ npm test
    

## A note on performance

The promises/a+ specification requires things to be asynchronous. To do that,
Pinky uses `process.nextTick` in Node.js, and `setImmediate` in a DOM
environment. However, `setImmediate` is a Microsoft thing, and it's unlikely to
be implemented anywhere else, and in that case we fall back to the slow
`setTimeout`. Thus, providing a fallback for `setImmediate` might speed things
up a bit.


## Documentation

A quick reference of the API can be built using [Calliope][]:

    $ npm install -g calliope
    $ calliope build


## Tests

You can run all tests using Mocha:

    $ npm test


## Licence

MIT/X11. ie.: do whatever you want.


## Why? WHY?

Most promise implementations I've seen plainly do way too much. OTOH Minimal
promise implementations (like [PinkySwear][]) provide a terrible API, which
really sucks.

So, I wrote Pinky to be a minimal and fast baseline for extensions to
promises/a+. Some implementation ideas are taken straight out from [avow][],
btw, but I might revisit this in the future and try to optimise things.



[Calliope]: https://github.com/robotlolita/calliope
[es5-shim]: https://github.com/kriskowal/es5-shim
[PinkySwear]: https://github.com/timjansen/PinkySwear.js
[avow]: https://github.com/briancavalier/avow

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