# stream-match

> Match a string in a stream. Zero dependencies

Latest version **4.1.0** (published 2023-05-04) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: esm support; no vulnerabilities; high maintenance score.

Warnings: low downloads; no types.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.1.0 |
| Published | 2023-05-04 |
| First published | 2019-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Maintainers | juliangruber |

## Links

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

## Dependencies (1)

- [abortable-iterator](https://npm.io/package/abortable-iterator.md) ^5.0.1

## Recent versions

- 4.1.0 (latest) — 2023-05-04
- 4.0.1 — 2023-05-03
- 4.0.0 — 2023-05-03
- 3.0.2 — 2023-04-27
- 3.0.1 — 2023-02-06
- 3.0.0 — 2022-12-11
- 2.0.0 — 2021-06-11
- 1.2.1 — 2020-02-06
- 1.2.0 — 2020-02-06
- 1.1.1 — 2019-11-12
- 1.1.0 — 2019-10-29
- 1.0.0 — 2019-10-17

## README

# stream-match

Match a regexp or string in a stream.

## Usage

```js
import match from 'stream-match'

// Given a readable stream,
const res = await match(stream, /(p[^n]+n)/)
// `res` will contain the RegExp result Array once it has been emitted

// You can also wait for a string to be emitted, for example:
await match(ps.stdout, 'continue now')
```

## Installation

```bash
$ npm install stream-match
```

## API

### res = await match(stream, pattern || string, { signal? })

Pass the optional `{ signal }` with an `AbortController#signal` to abort early.
In this case, an `Error` with `.code = 'ABORT_ERR'` will be thrown.

## License

MIT

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