etch_javascript
JavaScript target package for etch — a Gleam TUI backend library.
This package provides the JavaScript FFI implementations for terminal raw mode and input handling. It must be used alongside the core etch package.
Installation
gleam add etch_javascript
Usage
The package exposes two modules:
-
etch/javascript/tty— Raw mode control and terminal information:enter_raw,exit_raw,is_raw_modewindow_size
-
etch/javascript/input— Event-driven input handling:init_event_server,poll,readget_cursor_position,get_keyboard_enhancement_flags
import etch/javascript/tty
import etch/javascript/input
pub fn main() {
let assert Ok(_) = tty.enter_raw()
input.init_event_server()
// ... handle events ...
}