Skip to content

Conversation

@tmcw
Copy link
Contributor

@tmcw tmcw commented Jan 26, 2026

Type

  • Documentation Update

Description

Per the referenced document, Effect has its own Streams construct, which is great. Many people are going to have their own streams from other platforms - mostly web streams and Node streams. There are ways to interoperate between these kinds of streams, but the documentation does not hint at what they are. This adds the first bit of documentation that tells how to interoperate, specifically how to create a Stream from a ReadableStream.

Related

cc @gcanti for review

@vercel
Copy link

vercel bot commented Jan 26, 2026

@tmcw is attempting to deploy a commit to the Effect Team on Vercel.

A member of the Team first needs to authorize it.

@tmcw
Copy link
Contributor Author

tmcw commented Jan 26, 2026

I'd also like to document:

  • Stream.toReadableStream. This doesn't feel like a case of "Consuming" the stream to me. I think it could fit in a new page like "Interoperating" or maybe mentioning it inline with fromReadableStream.
  • Create a stream from a Node stream. I think this would be a note under, and an additional example for, fromAsyncIterator.

Proposed code example for Node.js interop:

import { Effect, Stream } from "effect"
import { Readable } from "node:stream";

const exampleStream = Readable.from(['Hello', 'world'])

const stream = Stream.fromAsyncIterable(
  exampleStream,
  (e) => new Error(String(e)) // Error Handling
)

Effect.runPromise(Stream.runCollect(stream)).then(console.log)
// { _id: 'Chunk', values: [ 1, 2 ] }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant