Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/olian04/gleam_stdin
This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun.
https://github.com/olian04/gleam_stdin
bun deno erlang gleam gleam-lang gleam-language nodejs stdin stdio
Last synced: 24 days ago
JSON representation
This package provides a synchronous iterator for consuming stdin. It supports all the non-browser targets, Erlang, Node, Deno, and Bun.
- Host: GitHub
- URL: https://github.com/olian04/gleam_stdin
- Owner: Olian04
- Created: 2024-06-03T08:05:54.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-06-11T15:09:15.000Z (5 months ago)
- Last Synced: 2024-10-12T18:41:37.107Z (24 days ago)
- Topics: bun, deno, erlang, gleam, gleam-lang, gleam-language, nodejs, stdin, stdio
- Language: JavaScript
- Homepage: https://hex.pm/packages/stdin
- Size: 7.81 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[![Package Version](https://img.shields.io/hexpm/v/stdin)](https://hex.pm/packages/stdin)
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/stdin/)# 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` |```sh
gleam add stdin
``````gleam
import gleam/io
import gleam/iterator
import stdin.{stdin}pub fn main() {
stdin()
|> iterator.to_list
|> io.debug
}
```Further documentation can be found at .
## Development
```sh
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
```