# pull-scan

> Scan algorithm for pull streams

Latest version **1.0.0** (published 2016-09-29) · ISC license · 0 weekly downloads

## Install

```sh
npm install pull-scan
pnpm add pull-scan
yarn add pull-scan
bun add pull-scan
```

## 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.0.0 |
| Published | 2016-09-29 |
| First published | 2016-09-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | nichoth |
| Maintainers | nichoth |
| Keywords | pull, stream, pull-stream, reduce, scan, through, transform |

## Links

- npm: https://www.npmjs.com/package/pull-scan
- Repository: https://github.com/nichoth/pull-scan
- Homepage: https://github.com/nichoth/pull-scan#readme
- Issues: https://github.com/nichoth/pull-scan/issues
- npm.io page: https://npm.io/package/pull-scan

## Dependencies (1)

- [pull-stream](https://npm.io/package/pull-stream.md) ^3.4.5

## 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.0.0 (latest) — 2016-09-29
- 0.0.4 — 2016-09-29
- 0.0.3 — 2016-09-29
- 0.0.2 — 2016-09-29
- 0.0.1 — 2016-09-29

## README

## pull scan [![Build Status](https://travis-ci.org/nichoth/pull-scan.svg?branch=master)](https://travis-ci.org/nichoth/pull-scan)

[Scan algorithm](https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/scan.md) for pull streams. It's like reduce, but emits intermediate values. So it's more like map but with an accumulator argument.

## example

```js
var test = require('tape')
var S = require('pull-stream')
var scan = require('../')

test('works given initial state', function (t) {
    t.plan(1)
    S(
        S.values([1,2,3]),

        scan(function (acc, n) {
            return acc + n
        }, 10),

        S.collect(function (err, data) {
            t.deepEqual(data, [11,13,16], 'should use init state argument')
        })
    )
})

test('use default init state', function (t) {
    t.plan(1)
    S(
        S.values([1,2,3]),

        scan(function (acc, n) {
            return acc + n
        }),

        S.collect(function (err, data) {
            t.deepEqual(data, [1,3,6],
                'should use first val as default state')
        })
    )
})
```

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