MCPcopy Create free account
hub / github.com/Effect-TS/effect / readStream

Function readStream

packages/platform/node/test/NodeHttpPlatform.test.ts:8–15  ·  view source on GitHub ↗
(stream: Readable)

Source from the content-addressed store, hash-verified

6import { Readable } from "node:stream"
7
8const readStream = (stream: Readable) =>
9 Effect.promise(async () => {
10 let text = ""
11 for await (const chunk of stream) {
12 text += typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8")
13 }
14 return text
15 })
16
17describe("NodeHttpPlatform", () => {
18 it.effect("fileResponse reads exact bytesToRead", () =>

Callers 1

Calls 1

toStringMethod · 0.65

Tested by

no test coverage detected