Package Version Hex Docs

stdin

stdin provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun.

The goal of this package is to provide a uniform way of consuming stdin for all supported targets on all supported platforms.

PlatformTested versionDate
Windows 102.0.02025-01-02
macOS 15.22.0.02025-01-02
Ubuntu 24.042.0.02025-01-02
Fedora 402.0.02025-01-02
gleam add stdin
import gleam/io
import gleam/yielder
import stdin

pub fn main() {
  stdin.read_lines()
  |> yielder.to_list
  |> io.debug
}

Further documentation can be found at https://hexdocs.pm/stdin.

Development

./run_test.sh
Search Document