Packages

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

Current section

Files

Jump to
stdin src stdin_test.gleam
Raw

src/stdin_test.gleam

import gleam/io
import gleam/iterator.{Next}
import stdin.{stdin}
pub fn main() {
let assert Next(line1, _) =
stdin()
|> iterator.step()
io.debug(line1)
let assert Next(line2, _) =
stdin()
|> iterator.step()
io.debug(line2)
}