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

Function fromWritable

packages/platform/node-shared/src/NodeSink.ts:29–37  ·  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

27 * @since 4.0.0
28 */
29export const fromWritable = <E, A = Uint8Array | string>(
30 options: {
31 readonly evaluate: LazyArg<Writable | NodeJS.WritableStream>
32 readonly onError: (error: unknown) => E
33 readonly endOnDone?: boolean | undefined
34 readonly encoding?: BufferEncoding | undefined
35 }
36): Sink.Sink<void, A, never, E> =>
37 Sink.fromChannel(Channel.mapDone(fromWritableChannel<never, E, A>(options), (_) => [_]))
38
39/**
40 * 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