# callbag-take

> Callbag operator that limits the total amount of data sent through

Latest version **1.5.0** (published 2020-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-take
pnpm add callbag-take
yarn add callbag-take
bun add callbag-take
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2020-03-11 |
| First published | 2018-01-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | staltz.com |
| Maintainers | staltz, zimme |
| Keywords | callbag |

## Links

- npm: https://www.npmjs.com/package/callbag-take
- Repository: https://github.com/staltz/callbag-take
- Homepage: https://github.com/staltz/callbag-take#readme
- Issues: https://github.com/staltz/callbag-take/issues
- npm.io page: https://npm.io/package/callbag-take

## Dependencies (1)

- [callbag](https://npm.io/package/callbag.md) ^1.1.0

## Recent versions

- 1.5.0 (latest) — 2020-03-11
- 1.4.0 — 2019-08-28
- 1.3.0 — 2019-08-27
- 1.2.0 — 2019-05-07
- 1.1.0 — 2019-02-09
- 1.0.0 — 2018-01-30

## README

# callbag-take

Callbag operator that limits the amount of data sent by a source. Works on either pullable and listenable sources.

`npm install callbag-take`

## example

On a listenable source:

```js
const interval = require('callbag-interval');
const observe = require('callbag-observe');
const take = require('callbag-take');

const source = take(3)(interval(1000));

source(0, observe(x => console.log(x))); // 0
                                         // 1
                                         // 2
```

On a pullable source:

```js
const fromIter = require('callbag-from-iter');
const iterate = require('callbag-iterate');
const take = require('callbag-take');

function* range(from, to) {
  let i = from;
  while (i <= to) {
    yield i;
    i++;
  }
}

const source = take(4)(fromIter(range(100, 999)));

source(0, iterate(x => console.log(x))); // 100
                                         // 101
                                         // 102
                                         // 103
```

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