@ssttevee/streamsearch
Version:
A port of streamsearch for es modules using Web APIs
25 lines (16 loc) • 636 B
Markdown
[](https://codecov.io/gh/ssttevee/streamsearch)
This module is a port of [streamsearch](https://github.com/mscdex/streamsearch) for es modules using Web APIs, namely `ReadableStream` and `Uint8Array`.
```bash
npm install @ssttevee/streamsearch
```
```js
import { ReadableStreamSearch } from '@ssttevee/streamsearch';
const res = await fetch('https://httpbin.org/stream/10');
const search = new ReadableStreamSearch('\n', res.body);
for await (const str of search.strings()) {
console.log(str);
}
```