{"_id":"@aitty/wterm-dom","_rev":"7-b75108235f7fd5248d0030cf6c146c56","name":"@aitty/wterm-dom","dist-tags":{"latest":"0.3.1-aitty.7"},"versions":{"0.3.1-aitty.1":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.1","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.1","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"f2d2061b6ee6f12919d74850dfea428b1c5489d1","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.1.tgz","fileCount":24,"integrity":"sha512-flW6EzCUDxQO3qYe4DVvmg0SMLoMe3hmtdXAgiBACnjy+mJKahL2IzDA7moYbm8+sP5KGfGB9QMHkXMcpU36og==","signatures":[{"sig":"MEYCIQCYzuD50rATc1MdphRYBfukP4UkhWd2MJYRpfPDwaFl/gIhAMY0knhQqum2YDnVxUwHXo90PktHXy/+CfUEzYbSImSW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":114898},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"1149231c595caf9bc1ce4ef25e0fc2d591f5c068","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.1_1778682566550_0.20221152637389794","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.2":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.2","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.2","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"7075f348e6f709c91c191fa7f3facaad724c2f17","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.2.tgz","fileCount":28,"integrity":"sha512-vxu0hFAWdI0aLWdgKkOqZ+p7dL6T/22qe5+8I89DFBMSYuw1XqNjg8RrcZc9Wj78491OJkS2ahUag1QpZc9Rvg==","signatures":[{"sig":"MEQCIBpXUKWWL7K/8hpyIKP2Q0MEQ49FTQGpLHIUCK6/81xjAiAaJuHjYgv2Ue8OOGYnrlzYE1yjQg13ZpG+pBLk4xmCmQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":122286},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"4ae314a8b7bc7b0827776104d14c223641dca33d","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.2_1778976546007_0.5901698567624443","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.3":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.3","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.3","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"ab52ce8324dc6d5d0af2080d5ef7cb37ddc2fa00","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.3.tgz","fileCount":28,"integrity":"sha512-MyIoT00e+jrNqA1Eh+WytiJyjY6j05JsHOTLymAtHunKzc0+kwxkW+47w9CcboMiSmk81kz/u4E+hwqZEowhLg==","signatures":[{"sig":"MEYCIQCs2oM44fupfDPJxB6k8ZegAZd/9zyNYd7HmpgBM1jNuAIhAOkFTGgPxM+Xx7+G1vKGDne/h/t9sNEs7WHsRDczLOJ8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":126328},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"4c9f5f271db0e5e9bd5c89ec1fa64d792bdbe7c0","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.3_1779021209460_0.038575584926900275","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.4":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.4","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.4","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"23c2d1e9f869e35f4036b04c54871d51e4210a16","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.4.tgz","fileCount":28,"integrity":"sha512-AhJXpu0EVuW4tJ/f3FNAhpA4YON0stBMIZNMHh8VjkTPgG52lYxGSjmNlQjFdSXb6hy1OeCk9DIbYUluYifc4A==","signatures":[{"sig":"MEQCIAm/DBpPMNSwFbMS5yFUMopSO+leLhhJ1yxZ9Zgzqh0lAiBEcvhwbIM9Mn3vJnWy3y41GGYgplM/AvVZRMTWPlAqIQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127945},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"e7ee3307932fc490f6a95edce3f54d2086bcde91","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.4"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.4_1779926902736_0.2890190650898088","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.5":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.5","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.5","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"8268538c5633d1fd22135b2571a368e5dec91aa8","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.5.tgz","fileCount":28,"integrity":"sha512-xj5G86apUc3UMoU+w/Jec6imEchqKwDuFAU+Xn+VYMCaeTIcfWRpeyEYBSFbgPVqlegrAQxNo8E8cKj+x3G0WQ==","signatures":[{"sig":"MEUCIHoePnxsFtSiCOn8b6TRtPBzYtWCXwp1dBMDU2yQu7j8AiEA4HP5WpZ2SJWjZHxLk/kY+gJqv2oKK1KO8jvtCm+SzTg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127945},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"defdc2071d720332ba02a5d54c4491006e9392c8","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.5"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.5_1780665285777_0.4395517934985722","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.6":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.6","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","_id":"@aitty/wterm-dom@0.3.1-aitty.6","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"homepage":"https://wterm.dev","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"dist":{"shasum":"4249504ea7efb2b62ef7caaa2fc8664a9471ce67","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.6.tgz","fileCount":28,"integrity":"sha512-LTSX/rju5ffrwQ3tz8LFJ/8fN0CdDGhDRq7ZsKD6FMQaJnzCMTJltI82jDuL08qqKxH7cj2UO4DOzL0NoJNQ3g==","signatures":[{"sig":"MEYCIQCxH1GpAmVqoz2xA8s2dX2LM8scdXQFhDR2D3Z7YOzhWAIhAP1MZzIzoukvXnklMN2xCOzKyOQpt2LI+YSimafn7hN9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":127945},"main":"dist/index.js","type":"module","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"gitHead":"fe926d7c695995d74bb7073db6fb79383a10df40","_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"repository":{"url":"git+https://github.com/kingsword09/wterm.git","type":"git","directory":"packages/@aitty/wterm-dom"},"_npmVersion":"11.11.1","description":"DOM renderer, input handler, and orchestrator for wterm","directories":{},"_nodeVersion":"25.8.2","dependencies":{"@aitty/wterm-core":"0.3.1-aitty.6"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/wterm-dom_0.3.1-aitty.6_1780841109173_0.6120247044973333","host":"s3://npm-registry-packages-npm-production"}},"0.3.1-aitty.7":{"name":"@aitty/wterm-dom","version":"0.3.1-aitty.7","description":"DOM renderer, input handler, and orchestrator for wterm","type":"module","main":"dist/index.js","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"},"./src/terminal.css":{"style":"./src/terminal.css","import":"./src/terminal.css","default":"./src/terminal.css"}},"dependencies":{"@aitty/wterm-core":"0.3.1-aitty.7"},"keywords":["terminal","emulator","wasm","zig","dom","xterm"],"license":"Apache-2.0","homepage":"https://wterm.dev","repository":{"type":"git","url":"git+https://github.com/kingsword09/wterm.git","directory":"packages/@aitty/wterm-dom"},"publishConfig":{"access":"public"},"gitHead":"2dba3da37df579604b7bd8c624ab7c9a81f43094","_id":"@aitty/wterm-dom@0.3.1-aitty.7","bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"_nodeVersion":"25.8.2","_npmVersion":"11.11.1","dist":{"integrity":"sha512-sonH3SQVxSOXOqMgBqzxoMRlXuQRRmRMkNfG28nMaWVUdopCpc9w8H7FxNvFsHNEXOphqkkcvzDvlhuZAxdTbw==","shasum":"56b63a846c3ece0cf0dae9c8384014a6c0695be2","tarball":"https://registry.npmjs.org/@aitty/wterm-dom/-/wterm-dom-0.3.1-aitty.7.tgz","fileCount":28,"unpackedSize":127945,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDpb375qmvCAoDVQ6CEG+ABg5BBib4nKfQaRHYLOQ/aOAIgZdALXYgMhnO5CLiQH+j++FC4AGZGBY+DD0k0hOIgd8U="}]},"_npmUser":{"name":"kingsword09","email":"kingsword09@gmail.com"},"directories":{},"maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/wterm-dom_0.3.1-aitty.7_1780870546869_0.059610099333380795"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T14:29:26.477Z","modified":"2026-06-07T22:15:47.120Z","0.3.1-aitty.1":"2026-05-13T14:29:26.696Z","0.3.1-aitty.2":"2026-05-17T00:09:06.174Z","0.3.1-aitty.3":"2026-05-17T12:33:29.604Z","0.3.1-aitty.4":"2026-05-28T00:08:22.903Z","0.3.1-aitty.5":"2026-06-05T13:14:45.921Z","0.3.1-aitty.6":"2026-06-07T14:05:09.329Z","0.3.1-aitty.7":"2026-06-07T22:15:47.008Z"},"bugs":{"url":"https://github.com/kingsword09/wterm/issues"},"license":"Apache-2.0","homepage":"https://wterm.dev","keywords":["terminal","emulator","wasm","zig","dom","xterm"],"repository":{"type":"git","url":"git+https://github.com/kingsword09/wterm.git","directory":"packages/@aitty/wterm-dom"},"description":"DOM renderer, input handler, and orchestrator for wterm","maintainers":[{"name":"kingsword09","email":"kingsword09@gmail.com"}],"readme":"# @aitty/wterm-dom\n\nDOM renderer, input handler, and orchestrator for [wterm](https://github.com/vercel-labs/wterm) — a terminal emulator for the web. No framework required.\n\nRe-exports everything from `@aitty/wterm-core`, so this is the only package you need for vanilla JS usage.\n\n## Install\n\n```bash\nnpm install @aitty/wterm-dom\n```\n\n## Usage\n\n```html\n<div id=\"terminal\"></div>\n\n<script type=\"module\">\n  import { WTerm } from \"@aitty/wterm-dom\";\n  import \"@aitty/wterm-dom/css\";\n\n  const term = new WTerm(document.getElementById(\"terminal\"));\n  await term.init();\n</script>\n```\n\nThe WASM binary is embedded in the package — no extra setup required. To serve it separately instead, pass `wasmUrl`.\n\nThe renderer respects terminal cell widths from `@aitty/wterm-core`, including\nwide/fullwidth characters and their zero-width spacer cells, so CJK text and\nemoji stay aligned with PTY applications that use terminal column widths.\n\n## API\n\n### `WTerm`\n\nThe main terminal class.\n\n```ts\nnew WTerm(element: HTMLElement, options?: WTermOptions)\n```\n\n**Options:**\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `cols` | `number` | `80` | Initial column count |\n| `rows` | `number` | `24` | Initial row count |\n| `wasmUrl` | `string` | — | Optional URL to serve the WASM binary separately (embedded by default) |\n| `autoResize` | `boolean` | `true` | Auto-resize based on container dimensions |\n| `cursorBlink` | `boolean` | `false` | Enable cursor blinking animation |\n| `debug` | `boolean` | `false` | Enable debug mode. Exposes a `DebugAdapter` on the instance (`wt.debug`) for inspecting escape sequences, cell data, render performance, and unhandled CSI sequences. |\n| `onData` | `(data: string) => void` | — | Called when the terminal produces data (user input or host response). When omitted, input is echoed back automatically. |\n| `onTitle` | `(title: string) => void` | — | Called when the terminal title changes |\n| `onResize` | `(cols: number, rows: number) => void` | — | Called on resize |\n\n**Methods:**\n\n| Method | Description |\n|---|---|\n| `init(): Promise<WTerm>` | Load WASM and start rendering |\n| `write(data: string \\| Uint8Array)` | Write data to the terminal |\n| `resize(cols, rows)` | Resize the terminal grid |\n| `focus()` | Focus the terminal element |\n| `getSelectionText()` | Return the current terminal-owned browser selection, with row-end padding trimmed |\n| `hasSelection()` | Check whether the active browser selection belongs to the terminal |\n| `clearSelection()` | Clear the active terminal-owned browser selection |\n| `destroy()` | Clean up event listeners and DOM |\n\n### `WebSocketTransport`\n\nConnect to a PTY backend over WebSocket (re-exported from `@aitty/wterm-core`).\n\n```ts\nimport { WTerm, WebSocketTransport } from \"@aitty/wterm-dom\";\n\nconst term = new WTerm(el, { cols: 80, rows: 24 });\nawait term.init();\n\nconst ws = new WebSocketTransport({\n  url: \"ws://localhost:8080/pty\",\n  onData: (data) => term.write(data),\n});\n\nws.connect();\nterm.onData = (data) => ws.send(data);\n```\n\n## Themes\n\nImport the stylesheet and apply a theme class to the terminal element:\n\n```js\nimport \"@aitty/wterm-dom/css\";\n```\n\nBuilt-in themes: `theme-solarized-dark`, `theme-monokai`, `theme-light`. Apply via class name:\n\n```js\nelement.classList.add(\"theme-monokai\");\n```\n\nAll colors use CSS custom properties (`--term-fg`, `--term-bg`, `--term-color-0` through `--term-color-15`, etc.) so you can define your own theme with plain CSS.\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}