Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

NodeTerminal unstable

Shared Node.js implementation of Effect's Terminal service.

NodeTerminal adapts Node's readline APIs plus the current process stdin and stdout streams into Terminal.Terminal. The service can display output, read a line, stream key input, and read terminal dimensions. make manages readline and TTY raw mode in a scope, while layer provides the default service that ends key input on bare Esc, Ctrl+C, or Ctrl+D.

2 exports Since v4.0.0 Source

Constructors

make

unstable
Since v4.0.0

Creates a scoped process-backed Terminal using Node readline, enabling TTY raw mode while key input is read. By default, Esc, Ctrl+C, and Ctrl+D end key input. Supply shouldQuit to override these quit keys.

Signature

declare const make: (shouldQuit?: (input: Terminal.UserInput) => boolean) => Effect.Effect<Terminal.Terminal, never, Scope.Scope>

Layers

layer

unstable
Since v4.0.0

Provides the default process-backed Terminal service, ending key input on bare Esc, Ctrl+C, or Ctrl+D.

Signature

declare const layer: Layer.Layer<Terminal.Terminal>