33A terminal rendering backend for [ Clay] ( https://github.com/nicbarker/clay ) ,
44compiled to WebAssembly.
55
6- With every frame, the entire UI tree is packed into a flat byte array
7- and sent to WASM in a single call. On the C side, Clay runs layout,
8- render commands are walked into a cell buffer, and the buffer is
9- diffed against the previous frame. Only the cells that actually
10- changed produce output. The result is an ANSI escape sequence that can
11- be written directly to stdout. One trip to WASM per frame, double
12- buffered, and only the bytes that need to change hit the output
6+ With every frame, the entire UI tree is packed into a flat byte array and sent
7+ to WASM in a single call. On the C side, Clay runs layout, render commands are
8+ walked into a cell buffer, and the buffer is diffed against the previous frame.
9+ Only the cells that actually changed produce output. The result is an ANSI
10+ escape sequence that can be written directly to stdout. One trip to WASM per
11+ frame, double buffered, and only the bytes that need to change hit the output
1312stream.
1413
1514Because the WASM module is pure computation with no I/O, it runs anywhere
@@ -34,7 +33,7 @@ WebAssembly does: Deno, Node, Bun, browsers, or any other runtime.
3433## Usage
3534
3635``` typescript
37- import { open , close , text , grow , rgba , createTerm } from " clayterm" ;
36+ import { close , createTerm , grow , open , rgba , text } from " clayterm" ;
3837
3938const term = await createTerm ({ width: 80 , height: 24 });
4039
@@ -46,7 +45,10 @@ const ansi = term.render([
4645 layout: { padding: { left: 2 , top: 1 } },
4746 border: {
4847 color: rgba (0 , 255 , 0 ),
49- left: 1 , right: 1 , top: 1 , bottom: 1 ,
48+ left: 1 ,
49+ right: 1 ,
50+ top: 1 ,
51+ bottom: 1 ,
5052 },
5153 cornerRadius: { tl: 1 , tr: 1 , bl: 1 , br: 1 },
5254 }),
0 commit comments