Skip to content
Match a regexp or string in a stream. Zero dependencies.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/workflows
.gitignore
README.md
index.js
package-lock.json
package.json
test.js

README.md

stream-match

Match a regexp or string in a stream. Zero dependencies.

Usage

const match = require('stream-match')

// Given a readable stream,
const res = await match(stream, /(p[^n]+n)/)
// `res` will containt `pattern` once it has been emitted.

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

Installation

$ npm install stream-match

API

res = await match(stream, pattern || string)

Sponsors

Development of this module is sponsored by:

Liberate Science

License

MIT

You can’t perform that action at this time.