{"_id":"supports-terminal-graphics","name":"supports-terminal-graphics","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"supports-terminal-graphics","version":"0.1.0","description":"Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/supports-terminal-graphics.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"browser":"browser.js","sideEffects":false,"engines":{"node":">=20"},"scripts":{"test":"xo && ava && tsc --lib es2022 index.d.ts"},"keywords":["terminal","graphics","kitty","iterm","iterm2","sixel","wezterm","konsole","ghostty","image","images","inline","protocol","detect","check","support","cli","tty","console"],"devDependencies":{"ava":"^6.4.1","typescript":"^5.9.3","xo":"^1.2.3"},"gitHead":"d973597157e977507b8139fa564bf091375e99aa","types":"./index.d.ts","_id":"supports-terminal-graphics@0.1.0","bugs":{"url":"https://github.com/sindresorhus/supports-terminal-graphics/issues"},"homepage":"https://github.com/sindresorhus/supports-terminal-graphics#readme","_nodeVersion":"24.12.0","_npmVersion":"11.6.1","dist":{"integrity":"sha512-+KdfozhS0Fw8y5Sghw8kkZNGT8nWYzJ1EzcoIvVjxhl+26TJTs26y02yfBgvc1jh5AS/c8jcI3xtahhR95KRyQ==","shasum":"1d599d12373e1ac1b8e7f4618888197950401f16","tarball":"https://registry.npmjs.org/supports-terminal-graphics/-/supports-terminal-graphics-0.1.0.tgz","fileCount":6,"unpackedSize":12247,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCZ/LaEkrXCj0ulW6nIogqsMD8qA+56+ff3L1/ifWWiGAIhAIUrxnHZJ950YYZ7hMrqNaWYsDFIN6ADhTjiNip2kVPd"}]},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/supports-terminal-graphics_0.1.0_1767538805230_0.6056096140586449"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-04T15:00:05.229Z","0.1.0":"2026-01-04T15:00:05.368Z","modified":"2026-01-04T15:00:05.642Z"},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"description":"Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)","homepage":"https://github.com/sindresorhus/supports-terminal-graphics#readme","keywords":["terminal","graphics","kitty","iterm","iterm2","sixel","wezterm","konsole","ghostty","image","images","inline","protocol","detect","check","support","cli","tty","console"],"repository":{"type":"git","url":"git+https://github.com/sindresorhus/supports-terminal-graphics.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"bugs":{"url":"https://github.com/sindresorhus/supports-terminal-graphics/issues"},"license":"MIT","readme":"# supports-terminal-graphics\n\n> Detect which terminal graphics protocols are supported ([Kitty](https://sw.kovidgoyal.net/kitty/graphics-protocol/), [iTerm2](https://iterm2.com/documentation-images.html), [Sixel](https://en.wikipedia.org/wiki/Sixel))\n\nDetects support for terminal graphics protocols using environment variables. This allows apps to choose the best available protocol for displaying images in the terminal.\n\n## Protocols\n\n| Protocol | Quality | Description |\n|----------|---------|-------------|\n| **Kitty** | Best | Truecolor RGBA, transparency, animation support |\n| **iTerm2** | Good | Full color, native macOS rendering |\n| **Sixel** | Basic | Palette-based, widely supported legacy protocol |\n\n## Install\n\n```sh\nnpm install supports-terminal-graphics\n```\n\n## Usage\n\n```js\nimport supportsTerminalGraphics from 'supports-terminal-graphics';\n\nif (supportsTerminalGraphics.stdout.kitty) {\n\t// Use Kitty graphics protocol (best quality)\n} else if (supportsTerminalGraphics.stdout.iterm2) {\n\t// Use iTerm2 inline images protocol\n} else if (supportsTerminalGraphics.stdout.sixel) {\n\t// Use Sixel protocol\n} else {\n\t// Fall back to ANSI block characters\n}\n```\n\nYou can also check `stderr`:\n\n```js\nif (supportsTerminalGraphics.stderr.kitty) {\n\t// Use Kitty graphics protocol on stderr\n}\n```\n\n## API\n\n### supportsTerminalGraphics\n\nReturns an object with `stdout` and `stderr` properties, each containing:\n\n- `kitty` - `boolean` - Whether Kitty graphics protocol is supported\n- `iterm2` - `boolean` - Whether iTerm2 inline images protocol is supported\n- `sixel` - `boolean` - Whether Sixel protocol is supported\n\n### createSupportsTerminalGraphics(stream?)\n\nCreate a custom check for a specific stream.\n\n```js\nimport {createSupportsTerminalGraphics} from 'supports-terminal-graphics';\n\nconst support = createSupportsTerminalGraphics(process.stdout);\n\nconsole.log(support.kitty);  // true or false\nconsole.log(support.iterm2); // true or false\nconsole.log(support.sixel);  // true or false\n```\n\n## Terminal Support\n\n| Terminal | Kitty | iTerm2 | Sixel |\n|----------|-------|--------|-------|\n| Kitty | ✓ | | |\n| Ghostty | ✓ | | |\n| WezTerm | ✓ | ✓ | ✓ |\n| iTerm2 (v3.6+) | ✓ | ✓ | |\n| iTerm2 (v2.9.20150512+) | | ✓ | |\n| Konsole (22.04+) | ✓ | ✓ | ✓ |\n| VS Code (v1.80+) | | ✓ | ✓ |\n| Rio | ✓ | ✓ | ✓ |\n| Warp | ✓ | | |\n| mintty | | ✓ | ✓ |\n| mlterm | | | ✓ |\n\n## Related\n\n- [supports-color](https://github.com/chalk/supports-color) - Detect whether a terminal supports color\n- [supports-hyperlinks](https://github.com/chalk/supports-hyperlinks) - Detect whether a terminal supports hyperlinks\n- [terminal-image](https://github.com/sindresorhus/terminal-image) - Display images in the terminal\n","readmeFilename":"readme.md","_rev":"1-17a22106bfd564730acd4c2472536ce2"}