UNPKG

2.36 kBMarkdownView Raw
1# <a href="http://kefirjs.github.io/kefir/"><img src="http://kefirjs.github.io/kefir/Kefir-with-bg.svg" width="60" height="60"></a> Kefir
2
3
4
5Kefir — is an Reactive Programming library for JavaScript
6inspired by [Bacon.js](https://github.com/baconjs/bacon.js)
7and [RxJS](https://github.com/Reactive-Extensions/RxJS)
8with focus on high performance and low memory usage.
9
10For docs visit [kefirjs.github.io/kefir](http://kefirjs.github.io/kefir).
11See also [Deprecated API docs](https://github.com/kefirjs/kefir/blob/master/deprecated-api-docs.md).
12
13
14
15[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/kefirjs/kefir/blob/master/LICENSE.txt)
16[![npm version](https://img.shields.io/npm/v/kefir.svg?style=flat)](https://www.npmjs.com/package/kefir)
17[![Build Status](https://travis-ci.org/kefirjs/kefir.svg?branch=master)](https://travis-ci.org/kefirjs/kefir)
18[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/pozadi/kefir?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
19
20
21
22# Installation
23
24Kefir available as NPM and Bower packages, as well as simple files download.
25
26### NPM
27```sh
28npm install kefir
29```
30
31### Bower
32```sh
33bower install kefir
34```
35
36### Download
37
38See [downloads](https://kefirjs.github.io/kefir/#downloads) section in the docs.
39
40Also available on [jsDelivr](http://www.jsdelivr.com/#!kefir).
41
42# Browsers support
43
44We don't support IE8 and below, aside from that Kefir should work in any browser.
45
46
47## [Flow](https://flowtype.org/)
48
49The NPM package ships with Flow definitions. So you can do something like this if you use Flow:
50
51```js
52// @flow
53
54import Kefir from 'kefir'
55
56function foo(numberStream: Kefir.Observable<number>) {
57 numberStream.onValue(x => {
58 // Flow knows x is a number here
59 });
60}
61
62const s = Kefir.constant(5);
63// Flow can automatically infer the type of values in the stream and determine
64// that `s` is of type Kefir.Observable<number> here.
65foo(s);
66```
67
68# Development
69
70```sh
71npm run prettify # makes source code pretty (you must run it before a PR could be merged)
72npm run build-js # builds js bundlers
73npm run test # runs all the checks
74npm run test-only # runs only unit tests without other checks
75npm run test-debug # runs tests with a chrome inspector connected to the node process
76npm run build-docs # builds the documentation html file
77```