text-stream-search
Version:
Searches for occurrences of a given search term in Node.js text streams
31 lines (20 loc) • 1.23 kB
Markdown
> Searches for occurrences of a given search term in a Node.js text stream
[](https://circleci.com/gh/Originate/node-text-stream-search)
[](https://david-dm.org/originate/node-text-stream-search)
[](https://david-dm.org/originate/node-text-stream-search#info=devDependencies)
Simple and robust way to scan text streams for text.
This works with anything that emits `data` events with text
in the form of Buffers or strings.
```javascript
import StreamSearch from "text-stream-search"
const streamSearch = new TextStreamSearch(myStream)
await streamSearch.waitForText("hello")
await streamSearch.waitForRegex("listening at port d+")
```
More use cases are described [here](features/wait.feature).
- [StreamSnitch](https://github.com/dmotz/stream-snitch): does the same thing with regular expressions,
but is buggy and blocks the event queue
See our [developer guidelines](CONTRIBUTING.md)