NodeTerminal.ts
NodeTerminal.ts overview
Section titled “NodeTerminal.ts overview”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 Ctrl+C or Ctrl+D.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”Creates a scoped process-backed Terminal using Node readline, enabling
TTY raw mode while in scope and using the supplied predicate to decide when
key input should end.
Signature
declare const make: ( shouldQuit?: (input: Terminal.UserInput) => boolean) => Effect.Effect<Terminal.Terminal, never, Scope.Scope>Since v4.0.0
layers
Section titled “layers”Provides the default process-backed Terminal service, ending key input on
Ctrl+C or Ctrl+D.
Signature
declare const layer: Layer.Layer<Terminal.Terminal, never, never>Since v4.0.0