4.1.0 • Published 1 year ago

stream-match v4.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
1 year ago

stream-match

Match a regexp or string in a stream.

Usage

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

$ 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

3.0.2

1 year ago

3.0.1

1 year ago

4.1.0

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

3.0.0

1 year ago

2.0.0

3 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.1

4 years ago

1.1.0

5 years ago

1.0.0

5 years ago