# proph

> A tiny, simple and fast futures implementation.

Latest version **0.1.0** (published 2014-10-21) · MIT license · 0 weekly downloads

## Install

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

## 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.1.0 |
| Published | 2014-10-21 |
| First published | 2014-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Tenor Biel |
| Maintainers | l8d |
| Keywords | monads, promises, futures, asynchronous, async |

## Links

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

## Alternatives

- [promise-throttle](https://npm.io/package/promise-throttle.md) — 44.2K weekly downloads
- [@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

## Recent versions

- 0.1.0 (latest) — 2014-10-21
- 0.0.1 — 2014-10-17

## README

proph [![Build Status](http://img.shields.io/travis/L8D/proph.svg?style=flat)](https://travis-ci.org/L8D/proph) [![NPM Version](http://img.shields.io/npm/v/proph.svg?style=flat)](https://npmjs.org/package/proph) [![License](http://img.shields.io/npm/l/proph.svg?style=flat)](https://github.com/L8D/proph/blob/master/LICENSE)
=====

A tiny, simple and fast futures implementation.

Usage
-----

```js
var Future = require('proph');
var fs = require('fs');

var readFile = Future.wrap(fs.readFile);

var files = Future.concat(readFile('README.md'), readFile('package.json'));

files.fork(function(err) {
  console.error('Error reading files: ' + err);
}, function(files) {
  console.log('README.md is ' + files[0].length + ' bytes');
  console.log('package.json is ' + files[1].length + ' bytes');
});
```

Or write your own wrappers!

```js
var Future = require('proph');
var fs = require('fs');

var exists = function(path) {
  return new Future(function(reject, resolve) {
    fs.exists(path, function(itExists) {
      if (itExists) {
        reject();
      } else {
        resolve();
      }
    });
  });
};

exists('package.json').fold(function() {
  console.log('nooo!');
}, function() {
  console.log('yay!');
}).exec();

function nop() {}
```

Install
-------

You can get proph on npm.

```bash
$ npm install --save proph
```

And even bower!

```bash
$ bower install --save proph
```

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