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

Function fromWritable

packages/platform/node-shared/src/NodeSink.ts:34–42  ·  view source on GitHub ↗
(
  options: {
    readonly evaluate: LazyArg<Writable | NodeJS.WritableStream>
    readonly onError: (error: unknown) => E
    readonly endOnDone?: boolean | undefined
    readonly encoding?: BufferEncoding | undefined
  }
)

Source from the content-addressed store, hash-verified

32 * @since 4.0.0
33 */
34export const fromWritable = <E, A = Uint8Array | string>(
35 options: {
36 readonly evaluate: LazyArg<Writable | NodeJS.WritableStream>
37 readonly onError: (error: unknown) => E
38 readonly endOnDone?: boolean | undefined
39 readonly encoding?: BufferEncoding | undefined
40 }
41): Sink.Sink<void, A, never, E> =>
42 Sink.fromChannel(Channel.mapDone(fromWritableChannel<never, E, A>(options), (_) => [_]))
43
44/**
45 * Creates a `Channel` that pulls chunks from upstream and writes them to a

Callers 1

NodeStdio.tsFile · 0.90

Calls 1

fromWritableChannelFunction · 0.85

Tested by

no test coverage detected