You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+22-17Lines changed: 22 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,47 +1,49 @@
1
1
# clayterm
2
2
3
-
A low-level, platform-independent terminal renderer and event parser for JavaScript. You can use clayterm directly, or as the foundation for your own framework.
3
+
A low-level, platform-independent terminal renderer and event parser for
4
+
JavaScript. You can use clayterm directly, or as the foundation for your own
5
+
framework.
4
6
5
7
## Features
6
8
7
-
**Declarative terminal UI** — Build terminal interfaces the same way you'd
8
-
build a web page. Clayterm uses [Clay](https://github.com/nicbarker/clay) under
9
-
the hood, giving you flexbox-like layout, pointer detection, and scroll
10
-
containers — all rendered to the terminal as box-drawing characters and ANSI
11
-
escape sequences.
9
+
**Declarative terminal UI** — Build terminal interfaces the same way you'd build
10
+
a web page. Clayterm uses [Clay](https://github.com/nicbarker/clay) under the
11
+
hood, giving you flexbox-like layout, pointer detection, and scroll containers —
12
+
all rendered to the terminal as box-drawing characters and ANSI escape
13
+
sequences.
12
14
13
15
**Zero I/O** — Clayterm never reads stdin or writes stdout. You feed it bytes
14
16
and get bytes back. This makes it trivially embeddable in any framework, any
15
17
runtime, any event loop. There are no opinions about how you do I/O, just pure
16
18
computation.
17
19
18
-
**Runs everywhere** — The entire engine is compiled to WebAssembly, so
19
-
clayterm will run anywhere JavaScript runs with no native
20
-
dependencies, and no build step for consumers.
20
+
**Runs everywhere** — The entire engine is compiled to WebAssembly, so clayterm
21
+
will run anywhere JavaScript runs with no native dependencies, and no build step
22
+
for consumers.
21
23
22
24
### Demo
23
25
24
26
The application in this demo uses Clayterm for all layout and input parsing
25
27
26
28
#### Keyboard Events
27
29
28
-
The input parser decodes raw terminal bytes into structured events.
29
-
Here you can see each key event as the string "hello world" is typed.
30
+
The input parser decodes raw terminal bytes into structured events. Here you can
31
+
see each key event as the string "hello world" is typed.
Clayterm does not do any I/O itself. On the ouput side, it converts UI elements into a raw sequence of bytes and pointer events, and on the input side, it converts a stream of raw bytes into structured events.
44
+
Clayterm does not do any I/O itself. On the ouput side, it converts UI elements
45
+
into a raw sequence of bytes and pointer events, and on the input side, it
46
+
converts a stream of raw bytes into structured events.
45
47
46
48
### Output
47
49
@@ -126,7 +128,10 @@ let { output } = term.render([
0 commit comments