# pull-live

> construct a pull-stream for reading from a writable source, can read old records, new (live) records, or both.

Latest version **1.0.1** (published 2016-05-20) · MIT license · 0 weekly downloads

## Install

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

## 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.1 |
| Published | 2016-05-20 |
| First published | 2016-05-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

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

## Dependencies (2)

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

## Recent versions

- 1.0.1 (latest) — 2016-05-20
- 1.0.0 — 2016-05-19

## README

# pull-live

construct a pull-stream for reading from a writable source,
can read old records, new (live) records, or both.

to be used by [pull-level](https://github.com/pull-stream/pull-level), 
[multiblobs](https://github.com/dominictarr/multiblob), and
[secure-scuttlebutt](https://github.com/ssbc/secure-scuttlebutt).
`pull-live` is generic, and easy to adapt to a new case.

## api: createLive(createSource(opts), createLive(opts)) => createLiveStream(opts)


createLive takes two functions, `createSource` (which returns a source
stream of the stored data) and `createLive` which returns a stream
of the live data. A function that takes `opts` and is returned.

if `opts.live` is set to true, the stream will only read the old data
(from `createSource`) and then the new data (from `createLive`) with
one item `{sync: true}` to mark when the old data has finished.

If `opts.sync === false` then the sync item will dropped.

if `opts.live` is  true (default: `false`) the live data is included.
if `opts.old` is false (default: `true`) the output will not include
the old data. If `live` and `old` are both false, an error is thrown.

the only valid options are `{live: true, old: false}` `{live: false, old: true}`
and `{live: true, old: true}`

I recomment using [pull-notify](https://github.com/pull-stream/pull-notify)
to implement `createLive`.

``` js
var MyLiveStream = createLive(createSource, createLive)

pull(MyLiveStrea({live:..., old:...}),...)
```


## License

MIT

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