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

Function fromReadable

packages/platform/node-shared/src/NodeStream.ts:59–72  ·  view source on GitHub ↗
(options: {
  readonly evaluate: LazyArg<Readable | NodeJS.ReadableStream>
  readonly onError?: (error: unknown) => E
  /**
   * Maximum number of Node reads per pull (default 4096). Set to Infinity
   * for unbounded batching. Does not control the size of each Node read.
   */
  readonly chunkSize?: number | undefined
  /**
   * Size passed to Node's `read(size)`. Omit to use Node's unsized reads.
   */
  readonly readSize?: number | undefined
  readonly closeOnDone?: boolean | undefined
})

Source from the content-addressed store, hash-verified

57 * @since 4.0.0
58 */
59export const fromReadable = <A = Uint8Array, E = Cause.UnknownError>(options: {
60 readonly evaluate: LazyArg<Readable | NodeJS.ReadableStream>
61 readonly onError?: (error: unknown) => E
62 /**
63 * Maximum number of Node reads per pull (default 4096). Set to Infinity
64 * for unbounded batching. Does not control the size of each Node read.
65 */
66 readonly chunkSize?: number | undefined
67 /**
68 * Size passed to Node's `read(size)`. Omit to use Node's unsized reads.
69 */
70 readonly readSize?: number | undefined
71 readonly closeOnDone?: boolean | undefined
72}): Stream.Stream<A, E> => Stream.fromChannel(fromReadableChannel<A, E>(options))
73
74/**
75 * Creates a `Channel` that pulls chunks from a Node readable stream, mapping

Callers 1

NodeStdio.tsFile · 0.90

Calls 1

fromReadableChannelFunction · 0.85

Tested by

no test coverage detected