{"_id":"@cjser/supports-terminal-graphics","name":"@cjser/supports-terminal-graphics","dist-tags":{"latest":"0.1.0-cjser.2"},"versions":{"0.1.0-cjser.2":{"name":"@cjser/supports-terminal-graphics","version":"0.1.0-cjser.2","description":"Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.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","require":"./dist-cjser/index.cjs","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"},"types":"./index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"0.1.0","cjserVersion":2,"original":{"name":"supports-terminal-graphics","version":"0.1.0","exports":{"types":"./index.d.ts","default":"./index.js"},"repository":"sindresorhus/supports-terminal-graphics","files":["index.js","index.d.ts","browser.js"],"scripts":{"test":"xo && ava && tsc --lib es2022 index.d.ts"}}},"_id":"@cjser/supports-terminal-graphics@0.1.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-w/uXb2j9LguCcmcSqC7EXE9BODYSh+O0pd8ZbwD6TWZchFTMfZlrOZ0QUmxenY3kom1Tq1/BSuRbWjV8zLsnFg==","shasum":"0170592a4428b62810fe53b16cf69badef020dc0","tarball":"https://registry.npmjs.org/@cjser/supports-terminal-graphics/-/supports-terminal-graphics-0.1.0-cjser.2.tgz","fileCount":7,"unpackedSize":19489,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDPhOANRaVhw7iGYsxG/iuy8xFJ4eu026/xs+/FE/2biAiBkebp1+1mm2ZqbMrgfKBpskJ2h7T38p5YWeod7EagQ1Q=="}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/supports-terminal-graphics_0.1.0-cjser.2_1778160287957_0.9380318646942063"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:24:47.889Z","0.1.0-cjser.2":"2026-05-07T13:24:48.133Z","modified":"2026-05-07T13:24:48.296Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Detect which terminal graphics protocols are supported (Kitty, iTerm2, Sixel)","keywords":["terminal","graphics","kitty","iterm","iterm2","sixel","wezterm","konsole","ghostty","image","images","inline","protocol","detect","check","support","cli","tty","console"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/supports-terminal-graphics\n","readmeFilename":"readme.md","_rev":"1-579764d21bd5d48e49f3539ad2ee9552"}