https://github.com/eu-ge-ne/kitty-keys
Kitty keyboard protocol parser library for Node.js, Deno and Bun.
https://github.com/eu-ge-ne/kitty-keys
bun deno javascript kitty-terminal nodejs parser terminal tui typescript
Last synced: 2 months ago
JSON representation
Kitty keyboard protocol parser library for Node.js, Deno and Bun.
- Host: GitHub
- URL: https://github.com/eu-ge-ne/kitty-keys
- Owner: eu-ge-ne
- License: mit
- Created: 2025-06-12T19:03:25.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-07-24T06:07:23.000Z (11 months ago)
- Last Synced: 2025-07-24T10:04:35.075Z (11 months ago)
- Topics: bun, deno, javascript, kitty-terminal, nodejs, parser, terminal, tui, typescript
- Language: TypeScript
- Homepage:
- Size: 96.7 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @eu-ge-ne/kitty-keys
[Kitty keyboard protocol](https://sw.kovidgoyal.net/kitty/keyboard-protocol)
parser library for Node.js, Deno and Bun.
[](https://jsr.io/@eu-ge-ne/kitty-keys)
[](https://jsr.io/@eu-ge-ne/kitty-keys)
[](https://codecov.io/gh/eu-ge-ne/kitty-keys)
- [Installation](#installation)
- [Deno](#deno)
- [Node.js](#nodejs)
- [Bun](#bun)
- [Example](#example)
- [Links](#links)
- [License](#license)
## Installation
### Deno
```bash
deno add jsr:@eu-ge-ne/kitty-keys
```
### Node.js
```bash
# pnpm
pnpm i jsr:@eu-ge-ne/kitty-keys
# yarn
yarn add jsr:@eu-ge-ne/kitty-keys
# npm
npx jsr add @eu-ge-ne/kitty-keys
```
### Bun
```bash
bunx jsr add @eu-ge-ne/kitty-keys
```
## Example
```ts ignore
import { Key, set_flags } from "jsr:@eu-ge-ne/kitty-keys";
Deno.stdin.setRaw(true);
const flags = set_flags({
disambiguate: true,
events: true,
alternates: true,
all_keys: true,
text: true,
});
Deno.stdout.writeSync(flags);
self.onunload = () => {
Deno.stdout.writeSync(set_flags({}));
console.log("Exit");
};
const reader = Deno.stdin.readable.getReader();
while (true) {
const { value } = await reader.read();
const result = Key.parse(value!);
if (!key) {
continue;
}
const [key, bytes_parsed] = result;
console.log(key);
if (key.name === "c" && key.ctrl) {
break;
}
}
```
## Links
-
-
## License
[MIT](https://choosealicense.com/licenses/mit)