# fairmont

> Functional reactive programming for JavaScript and CoffeeScript.

Latest version **2.0.1** (published 2017-02-07) · ISC license · 0 weekly downloads

## Install

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

## 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 | 2.0.1 |
| Published | 2017-02-07 |
| First published | 2012-10-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 49 |
| Maintainers | automatthew, benniemosher, diminish7, dyoder, f1337, maheshyellai, pandanick, pandapup |
| Keywords | coffee, coffeescript, utility |

## Links

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

## Dependencies (6)

- [fairmont-core](https://npm.io/package/fairmont-core.md) ^1.0.0
- [fairmont-helpers](https://npm.io/package/fairmont-helpers.md) ^2.0.0
- [fairmont-process](https://npm.io/package/fairmont-process.md) ^2.0.0
- [fairmont-reactive](https://npm.io/package/fairmont-reactive.md) ^2.0.0
- [fairmont-filesystem](https://npm.io/package/fairmont-filesystem.md) ^2.0.0
- [fairmont-multimethods](https://npm.io/package/fairmont-multimethods.md) ^1.0.0

## Alternatives

- [lodash.assign](https://npm.io/package/lodash.assign.md) — 2.3M weekly downloads
- [lodash.chunk](https://npm.io/package/lodash.chunk.md) — 1.8M weekly downloads
- [react-native-ios-utilities](https://npm.io/package/react-native-ios-utilities.md) — 138.5K weekly downloads
- [@technically/lodash](https://npm.io/package/@technically/lodash.md) — 50.9K weekly downloads
- [@fluid-topics/ft-icon](https://npm.io/package/@fluid-topics/ft-icon.md) — 20.6K weekly downloads

## Recent versions

- 2.0.1 (latest) — 2017-02-07
- 2.0.0 — 2017-02-06
- 1.1.6 — 2016-05-04
- 1.1.5 — 2016-05-03
- 1.1.4 — 2016-05-03
- 1.1.3 — 2016-05-03
- 1.1.2 — 2016-05-02
- 1.1.1 — 2016-05-02
- 1.1.0 — 2016-05-01
- 1.0.0 — 2016-04-15
- 1.0.0-beta-40 — 2015-11-06
- 1.0.0-beta-39 — 2015-10-13
- 1.0.0-beta-38 — 2015-10-13
- 1.0.0-beta-37 — 2015-10-13
- 1.0.0-beta-36 — 2015-10-09
- … 75 more at https://npm.io/package/fairmont/versions

## README

# Fairmont

Fairmont is a family of JavaScript libraries for functional reactive programming.
Fairmont takes full advantage of ES6+ features like iterators (including async iterators), generators, and promises.
Inspired by libraries like [Underscore](http://underscorejs.org/) and many others, Fairmont features include:

* reactive programming support through async iterators
* lazy evaluation on collection operations via iterators
* core functional operations, like currying and composition
* bridge functions for integrating with OOP-based libraries
* common file and stream based operations
* streams and event emitters modeled as asynchronous iterators
* observers for reacting to changes in state
* unifies synchronous and asynchronous programming models

## Examples

Here's a simple reactive Web app implementing a counter using Fairmont's Reactive programming functions.

In JavaScript:

```javascript
var $ = require("jquery"),
  F = require("fairmont");

$(function() {

  var data = { counter: 0 };

  F.go([
    F.events("click", $("a[href='#increment']")),
    F.map(function() { data.counter++; })
  ]);

  F.go([
    F.events("change", F.observe(data)),
    F.map(function() {
      $("p.counter")
        .html(data.counter);
    })
  ]);
});

```

In CoffeeScript:

```coffeescript
{start, flow, events, map, observe} = require "fairmont-reactive"

$ = require "jquery"

$ ->

  data = counter: 0

  go [
    events "click", $("a[href='#increment']")
    map -> data.counter++
  ]

  go [
    events "change", observe data
    map ->
      $("p.counter")
      .html data.counter
  ]
```

You can run [this example][] or look at our other reactive examples:

- a [todo-list][]
- an [echo server][]
- a [Web server][]
- a [file watcher][]

[this example]:https://github.com/pandastrike/fairmont-reactive/blob/master/examples/web-apps/counter
[todo-list]:https://github.com/pandastrike/fairmont-reactive/blob/master/examples/web-apps/todo-list
[echo server]:https://github.com/pandastrike/fairmont-reactive/blob/master/examples/echo-server.litcoffee
[Web server]:https://github.com/pandastrike/fairmont-reactive/blob/master/examples/web-server.litcoffee
[file watcher]:https://github.com/pandastrike/fairmont-reactive/blob/master/examples/file-watcher.litcoffee

## Installation

You can simply install Fairmont as a whole:

`npm install fairmont`

Or you can simply install the components you need.

Example:

`npm install fairmont-core`

Learn more about the individual Fairmont components by clicking on the links below:

- [fairmont-core][]
- [fairmont-reactive][]
- [fairmont-multimethods][]
- [fairmont-helpers][]
- [fairmont-crypto][]
- [fairmont-process][]
- [fairmont-filesystem][]

The [API Reference] provides documentation on each component and its corresponding functions.

## Status

Fairmont is available for production use.
We use Fairmont is wide-variety of development projects.
We welcome contributors!

## Roadmap

You can get an idea of what we're planning by looking at the [tickets][]. If you want something that isn't there, and you think it would be a good addition, please open a ticket.

[tickets]:https://github.com/pandastrike/fairmont/issues
[fairmont]:https://github.com/pandastrike/fairmont
[fairmont-core]:https://github.com/pandastrike/fairmont-core
[fairmont-reactive]:https://github.com/pandastrike/fairmont-reactive
[fairmont-multimethods]:https://github.com/pandastrike/fairmont-multimethods
[fairmont-helpers]:https://github.com/pandastrike/fairmont-helpers
[fairmont-crypto]:https://github.com/pandastrike/fairmont-crypto
[fairmont-process]:https://github.com/pandastrike/fairmont-process
[fairmont-filesystem]:https://github.com/pandastrike/fairmont-filesystem
[API Reference]:https://github.com/pandastrike/fairmont/wiki/API-Reference

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