vt100.js 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -12
- package/LICENSE +0 -21
- package/README.md +0 -131
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vt100.js",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Pure TypeScript VT100 terminal emulator. Zero dependencies, headless, fast.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ansi",
|
|
@@ -11,26 +11,25 @@
|
|
|
11
11
|
"vt100",
|
|
12
12
|
"zero-dependency"
|
|
13
13
|
],
|
|
14
|
-
"homepage": "https://github.com/beorn/vt100",
|
|
15
|
-
"bugs": "https://github.com/beorn/
|
|
14
|
+
"homepage": "https://github.com/beorn/vterm/tree/main/packages/vt100",
|
|
15
|
+
"bugs": "https://github.com/beorn/vterm/issues",
|
|
16
16
|
"license": "MIT",
|
|
17
17
|
"author": "Beorn",
|
|
18
|
-
"repository":
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "https://github.com/beorn/vterm.git",
|
|
21
|
+
"directory": "packages/vt100"
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"src"
|
|
25
|
+
],
|
|
19
26
|
"type": "module",
|
|
20
27
|
"exports": {
|
|
21
28
|
".": "./src/index.ts"
|
|
22
29
|
},
|
|
23
|
-
"files": ["src"],
|
|
24
30
|
"publishConfig": {
|
|
25
31
|
"access": "public"
|
|
26
32
|
},
|
|
27
|
-
"scripts": {
|
|
28
|
-
"test": "vitest run",
|
|
29
|
-
"typecheck": "tsc --noEmit"
|
|
30
|
-
},
|
|
31
|
-
"devDependencies": {
|
|
32
|
-
"vitest": "^4.0.0"
|
|
33
|
-
},
|
|
34
33
|
"engines": {
|
|
35
34
|
"node": ">=23.6.0"
|
|
36
35
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Beorn
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
package/README.md
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# vt100.js
|
|
2
|
-
|
|
3
|
-
Pure TypeScript VT100 terminal emulator. Zero dependencies, headless, fast.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- Full VT100/ANSI escape sequence parsing
|
|
8
|
-
- SGR attributes (bold, italic, underline, colors, etc.)
|
|
9
|
-
- 16-color, 256-color, and 24-bit truecolor support
|
|
10
|
-
- Cursor movement, save/restore (DECSC/DECRC)
|
|
11
|
-
- Screen modes (alternate screen, auto-wrap, origin mode, etc.)
|
|
12
|
-
- Scroll regions (DECSTBM) with content preservation
|
|
13
|
-
- Scrollback buffer with configurable limit
|
|
14
|
-
- Insert/delete characters and lines
|
|
15
|
-
- Wide character support (CJK, emoji)
|
|
16
|
-
- Zero dependencies -- works in Bun, Node.js, and browsers
|
|
17
|
-
|
|
18
|
-
## Comparison
|
|
19
|
-
|
|
20
|
-
| Package | Screen State | SGR Colors | Scrollback | Wide Chars | Zero Deps | Size |
|
|
21
|
-
| ------------------------- | :----------: | :---------: | :--------: | :--------: | :-------: | :----------: |
|
|
22
|
-
| **vt100.js** | yes | 16/256/true | yes | yes | yes | ~30KB |
|
|
23
|
-
| `@xterm/headless` | yes | 16/256/true | yes | yes | no | ~500KB |
|
|
24
|
-
| `node-pty` + xterm | yes | 16/256/true | yes | yes | no | native build |
|
|
25
|
-
| `ansi-parser` | no | parse only | no | no | yes | ~5KB |
|
|
26
|
-
| `terminal-kit` | yes | 16/256/true | no | partial | no | ~2MB |
|
|
27
|
-
| `blessed` / `neo-blessed` | yes | 16/256 | no | no | no | ~1MB |
|
|
28
|
-
|
|
29
|
-
## Install
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
npm install vt100.js
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
## Usage
|
|
36
|
-
|
|
37
|
-
```typescript
|
|
38
|
-
import { createVt100Screen } from "vt100.js"
|
|
39
|
-
|
|
40
|
-
const screen = createVt100Screen({ cols: 80, rows: 24 })
|
|
41
|
-
screen.process(new TextEncoder().encode("Hello, \x1b[1mBold\x1b[0m World!"))
|
|
42
|
-
|
|
43
|
-
// Read cell state
|
|
44
|
-
const cell = screen.getCell(0, 0)
|
|
45
|
-
console.log(cell.char) // "H"
|
|
46
|
-
|
|
47
|
-
// Read text
|
|
48
|
-
console.log(screen.getText()) // "Hello, Bold World!"
|
|
49
|
-
|
|
50
|
-
// Check cursor position
|
|
51
|
-
const pos = screen.getCursorPosition()
|
|
52
|
-
console.log(pos) // { x: 18, y: 0 }
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
## API
|
|
56
|
-
|
|
57
|
-
### `createVt100Screen(options)`
|
|
58
|
-
|
|
59
|
-
Create a new screen instance.
|
|
60
|
-
|
|
61
|
-
```typescript
|
|
62
|
-
const screen = createVt100Screen({
|
|
63
|
-
cols: 80, // terminal width
|
|
64
|
-
rows: 24, // terminal height
|
|
65
|
-
scrollbackLimit: 1000, // max scrollback lines (default: 1000)
|
|
66
|
-
})
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Screen methods
|
|
70
|
-
|
|
71
|
-
| Method | Description |
|
|
72
|
-
| -------------------------------------------------- | --------------------------------------------------------- |
|
|
73
|
-
| `process(data: Uint8Array)` | Feed raw terminal data |
|
|
74
|
-
| `getText()` | Get all text (scrollback + screen) |
|
|
75
|
-
| `getTextRange(startRow, startCol, endRow, endCol)` | Get text in a range |
|
|
76
|
-
| `getLine(row)` | Get cells for a row |
|
|
77
|
-
| `getCell(row, col)` | Get a single cell (char, fg, bg, bold, etc.) |
|
|
78
|
-
| `getCursorPosition()` | Get cursor `{ x, y }` |
|
|
79
|
-
| `getCursorVisible()` | Check cursor visibility |
|
|
80
|
-
| `getMode(mode)` | Check terminal mode (`altScreen`, `bracketedPaste`, etc.) |
|
|
81
|
-
| `getTitle()` | Get window title (set via OSC 0/2) |
|
|
82
|
-
| `getScrollbackLength()` | Number of scrollback lines |
|
|
83
|
-
| `getViewportOffset()` | Current viewport scroll offset |
|
|
84
|
-
| `scrollViewport(delta)` | Scroll viewport by delta lines |
|
|
85
|
-
| `resize(cols, rows)` | Resize the terminal |
|
|
86
|
-
| `reset()` | Reset to initial state |
|
|
87
|
-
|
|
88
|
-
### Cell properties
|
|
89
|
-
|
|
90
|
-
```typescript
|
|
91
|
-
interface ScreenCell {
|
|
92
|
-
char: string // character content
|
|
93
|
-
fg: CellColor | null // foreground color { r, g, b }
|
|
94
|
-
bg: CellColor | null // background color { r, g, b }
|
|
95
|
-
bold: boolean
|
|
96
|
-
faint: boolean
|
|
97
|
-
italic: boolean
|
|
98
|
-
underline: UnderlineStyle // "none" | "single" | "double" | "curly" | "dotted" | "dashed"
|
|
99
|
-
strikethrough: boolean
|
|
100
|
-
inverse: boolean
|
|
101
|
-
hidden: boolean
|
|
102
|
-
wide: boolean // true for CJK/emoji double-width chars
|
|
103
|
-
}
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Terminal modes
|
|
107
|
-
|
|
108
|
-
Queryable via `screen.getMode(mode)`:
|
|
109
|
-
|
|
110
|
-
- `altScreen` -- alternate screen buffer
|
|
111
|
-
- `bracketedPaste` -- bracketed paste mode
|
|
112
|
-
- `mouseTracking` -- mouse tracking
|
|
113
|
-
- `autoWrap` -- auto-wrap at right margin (default: on)
|
|
114
|
-
- `applicationCursor` -- application cursor keys
|
|
115
|
-
- `applicationKeypad` -- application keypad mode
|
|
116
|
-
- `originMode` -- origin mode
|
|
117
|
-
- `insertMode` -- insert mode
|
|
118
|
-
- `reverseVideo` -- reverse video
|
|
119
|
-
- `focusTracking` -- focus tracking
|
|
120
|
-
- `cursorVisible` -- cursor visibility
|
|
121
|
-
|
|
122
|
-
## Ecosystem
|
|
123
|
-
|
|
124
|
-
- [Termless](https://termless.dev) -- headless terminal testing (uses vt100.js as its default backend)
|
|
125
|
-
- [Terminfo.dev](https://terminfo.dev) -- terminal feature support tables
|
|
126
|
-
- [Silvery](https://silvery.dev) -- React TUI framework
|
|
127
|
-
- [@termless/vt100](https://github.com/beorn/termless) -- Termless backend wrapper for vt100.js
|
|
128
|
-
|
|
129
|
-
## License
|
|
130
|
-
|
|
131
|
-
MIT
|