# stream-filter

> Filter data passed through

Latest version **2.1.0** (published 2016-09-02) · Public Domain license · 0 weekly downloads

## Install

```sh
npm install stream-filter
pnpm add stream-filter
yarn add stream-filter
bun add stream-filter
```

## 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 | 2.1.0 |
| Published | 2016-09-02 |
| First published | 2013-08-09 |
| Weekly downloads | 0 |
| License | Public Domain |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Parsha Pourkhomami |
| Maintainers | parshap |
| Keywords | stream, filter |

## Links

- npm: https://www.npmjs.com/package/stream-filter
- Repository: https://github.com/parshap/node-stream-filter
- Homepage: https://github.com/parshap/node-stream-filter#readme
- Issues: https://github.com/parshap/node-stream-filter/issues
- npm.io page: https://npm.io/package/stream-filter

## Dependencies (2)

- [xtend](https://npm.io/package/xtend.md) ^4.0.1
- [through2](https://npm.io/package/through2.md) ^2.0.1

## 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

- 2.1.0 (latest) — 2016-09-02
- 2.0.0 — 2016-08-30
- 1.0.0 — 2013-08-09

## README

# stream-filter

Filter data using a [through stream](https://github.com/rvagg/through2).

[![build status](https://img.shields.io/travis/parshap/node-stream-filter.svg)](https://travis-ci.org/parshap/node-stream-filter)

## Installation

[npm: *stream-filter*](https://www.npmjs.com/package/stream-filter)

```
npm install stream-filter
```

## Example

```js
var filter = require("stream-filter");

process.stdin.pipe(filter(function(data) {
	return data.length > 2;
})).pipe(process.stdout);
```

### Async Filter Function

```js
var filter = require("stream-filter");

process.stdin.pipe(filter.async(function(data, callback) {
	doAsyncThing(data, function(err, size) {
		callback(err, size > 2);
	});
})).pipe(process.stdout);
```

## API

```js
var filter = require("stream-filter");
filter(fn, options);
filter.obj(fn, options);
filter.async(fn, options);
filter.async.obj(fn, options);
```

Note that `filter.obj(fn)` and `filter.async.obj(fn)` are convenience
wrappers to pass `{ objectMode: true }`.

See [index.js](./index.js) and [test.js](./test.js) for API details.

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