Package Version Hex Docs


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.

PlatformTarget StatusDate
Windows 10All OK.2024-06-08
macOS 14.5All OK.2024-06-11
Ubuntu 24.04All OK.2024-06-11
Fedora 40All OK.2024-06-11
gleam add stdin
import gleam/io
import gleam/iterator
import stdin.{stdin}

pub fn main() {
  |> iterator.to_list
  |> io.debug

Further documentation can be found at


cat | gleam test --target=javascript --runtime=node
cat | gleam test --target=javascript --runtime=bun
cat | gleam test --target=javascript --runtime=deno
cat | gleam test --target=erlang
Search Document