Skip to content

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

Notifications You must be signed in to change notification settings

Olian04/gleam_stdin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

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

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

Development

cat README.md | gleam test --target=javascript --runtime=node
cat README.md | gleam test --target=javascript --runtime=bun
cat README.md | gleam test --target=javascript --runtime=deno
cat README.md | gleam test --target=erlang

About

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

Topics

Resources

Stars

Watchers

Forks