# praan

> a reactive stream model for programming

Latest version **1.4.0** (published 2017-07-14) · MIT license · 0 weekly downloads

## Install

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

## 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 | 1.4.0 |
| Published | 2017-07-14 |
| First published | 2017-07-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | IAIAE |
| Maintainers | richcao_at_tencent |
| Keywords | reactive, stream |

## Links

- npm: https://www.npmjs.com/package/praan
- Repository: https://github.com/IAIAE/Praan
- Homepage: https://github.com/IAIAE/Praan#readme
- Issues: https://github.com/IAIAE/Praan/issues
- npm.io page: https://npm.io/package/praan

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 1.4.0 (latest) — 2017-07-14
- 1.3.2 — 2017-07-14
- 1.3.1 — 2017-07-14
- 1.3.0 — 2017-07-14
- 1.2.3 — 2017-07-12
- 1.2.2 — 2017-07-12
- 1.2.1 — 2017-07-11
- 1.1.1 — 2017-07-11
- 1.0.1 — 2017-07-11
- 1.0.0 — 2017-07-11

## README

# Praan
> The same stream of life that runs through my veins night and day runs through the world and dances in rhythmic measures. 
<div style="text-align:right">-Praan</div>

praan is a Functor for reactive programming. if you like functional programming, you can use of/map/flatMap/flat/ap as you like, and all the function will return a new stream.

you can associate a stream with an array that expose it's element at the right time. for example, a stream of [1,2,3,4] is an array expose 1,2,3,4 immediately. and a stream of user input is an array that expose a data when user input a value.

you can observe a stream `stream.observe(fn)`, and `fn` will be call every time there is a value in the stream to be exposed.
## Install
```shell
npm install praan
```

```javascript
// es6 
import praan from 'praan';

// es5
var praan = require('praan');
```

## example

```javascript
var stream = praan.of([1,2,3,4]);
    .then(item=>item+1);
stream.observe(console.info);   // 1,2,3,4


/**
 * promise
 */
praan.fromPromise(Promise.resolve('praan'));

/**
 * exception catch
 */
praan.fromPromise(Promise.reject({msg:'opps! promise reject at beginning!!'})))
    .then(data=>data+1)
    .then(data=> praan.of(getPromise(data)))
    .catch(e=>{
        console.info(e)    //{msg:'opps! promise reject at beginning!!'}
    })
    .start()
// -----praan----
```

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