# pull-flatmap

> flatmap for pull-streams

Latest version **0.0.1** (published 2016-10-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2016-10-23 |
| First published | 2016-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | 'Dominic Tarr' |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/pull-flatmap
- Repository: https://github.com/dominictarr/pull-flatmap
- Issues: https://github.com/dominictarr/pull-flatmap/issues
- npm.io page: https://npm.io/package/pull-flatmap

## Recent versions

- 0.0.1 (latest) — 2016-10-23
- 0.0.0 — 2016-08-25

## README

# pull-flatmap

flatmap for pull-streams

map an input to an array, but the items in those arrays become the stream.
so you can use this module to make expanding or contracting streams.

taken from example on [introduction to pull-streams](http://dominictarr.com/post/149248845122/pull-streams-pull-streams-are-a-very-simple)

## example

``` js
var pull = require('pull-stream')
pull(
  pull.values([1,2,3]),
  flatmap(function (n) {
    //return an array of n n's [2,2] or [3,3,3], etc
    return new Array(n).map(function () { return n })
  }),
  pull.collect(function (err, ary) {
    if(err) throw err
    console.log(ary)
  })
)
```
output:
```
[1, 2, 2, 3, 3, 3]
```

## License

MIT

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