Hyperlinkv0.8.0-beta.28

Stdio

Stdio.Stdiointerfaceeffect/Stdio.ts:63
Stdio

Defines the service interface for process standard I/O.

When to use

Use to depend on command-line arguments and standard I/O through the Effect environment.

Details

The service provides command-line arguments, sinks for standard output and standard error, and a stream of standard input bytes. I/O operations can fail with PlatformError.

models
Source effect/Stdio.ts:6326 lines
export interface Stdio {
  readonly [TypeId]: TypeId
  readonly args: Effect.Effect<ReadonlyArray<string>>
  stdout(options?: {
    readonly endOnDone?: boolean | undefined
  }): Sink.Sink<void, string | Uint8Array, never, PlatformError>
  stderr(options?: {
    readonly endOnDone?: boolean | undefined
  }): Sink.Sink<void, string | Uint8Array, never, PlatformError>
  readonly stdin: Stream.Stream<Uint8Array, PlatformError>
}
/**
 * Service tag for process standard I/O.
 *
 * **When to use**
 *
 * Use when you need command-line arguments or standard I/O streams supplied by
 * an effect's environment.
 *
 * @see {@link make} for constructing a `Stdio` service directly
 * @see {@link layerTest} for a test layer with defaults and overrides
 *
 * @category services
 * @since 4.0.0
 */
export const Stdio: Context.Service<Stdio, Stdio> = Context.Service<Stdio>(TypeId)
Referenced by 4 symbols