# monitor-head-stream

> Monitor the head of a stream.

Latest version **0.1.2** (published 2017-02-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install monitor-head-stream
pnpm add monitor-head-stream
yarn add monitor-head-stream
bun add monitor-head-stream
```

## 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.1.2 |
| Published | 2017-02-02 |
| First published | 2017-02-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | ^6 |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Seb Insua |
| Maintainers | sebinsua |

## Links

- npm: https://www.npmjs.com/package/monitor-head-stream
- Repository: https://github.com/sebinsua/monitor-head-stream
- Homepage: https://github.com/sebinsua/monitor-head-stream#readme
- Issues: https://github.com/sebinsua/monitor-head-stream/issues
- npm.io page: https://npm.io/package/monitor-head-stream

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^2.6.0
- [continue-stream](https://npm.io/package/continue-stream.md) ^2.0.0
- [readable-stream](https://npm.io/package/readable-stream.md) ^2.2.2

## Recent versions

- 0.1.2 (latest) — 2017-02-02
- 0.1.0 — 2017-02-02

## README

# `monitor-head-stream` [![Build Status](https://travis-ci.org/sebinsua/monitor-head-stream.png)](https://travis-ci.org/sebinsua/monitor-head-stream) [![npm version](https://badge.fury.io/js/monitor-head-stream.svg)](https://npmjs.org/package/monitor-head-stream)
> 💦 Monitor the head of a stream

This module polls streams of objects for their latest item(s).

It's sort of like `tail -f` for [`Stream`s](https://nodejs.org/api/stream.html), but acts upon the head of the stream.

It was created in order to help implement small-scale firehoses.

## Example

```js
import { TimelineStream } from 'scrape-twitter'
import JSONStream from 'JSONStream'
import pump from 'pump'

import monitorHeadStream from 'monitor-head-stream'

const createStream = () => new TimelineStream('POTUS')
const indexBy = obj => obj.id
const skipWhenPinned = obj => obj.isPinned === true

pump(
  monitorHeadStream(createStream, indexBy, skipWhenPinned),
  JSONStream.stringify('[\n', ',\n', '\n]\n'),
  process.stdout
)
```

## Install

*With `yarn`*:
```sh
yarn add monitor-head-stream
```

*With `npm`*:
```sh
npm install --save monitor-head-stream
```

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