{"_id":"@cjser/supports-color__v9_4_0","name":"@cjser/supports-color__v9_4_0","dist-tags":{"latest":"9.4.0-cjser.2"},"versions":{"9.4.0-cjser.2":{"name":"@cjser/supports-color__v9_4_0","version":"9.4.0-cjser.2","description":"Detect whether a terminal supports color","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/chalk/supports-color?sponsor=1","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","node":"./index.js","default":"./browser.js"},"engines":{"node":">=12"},"scripts":{"//test":"xo && ava && tsd","test":"tsd"},"keywords":["color","colour","colors","terminal","console","cli","ansi","styles","tty","rgb","256","shell","xterm","command-line","support","supports","capability","detect","truecolor","16m"],"devDependencies":{"@types/node":"^20.3.2","ava":"^5.3.1","import-fresh":"^3.3.0","tsd":"^0.18.0","xo":"^0.54.2"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"9.4.0","cjserVersion":2,"original":{"name":"supports-color","version":"9.4.0","exports":{"node":"./index.js","default":"./browser.js"},"repository":"chalk/supports-color","files":["index.js","index.d.ts","browser.js","browser.d.ts"],"scripts":{"//test":"xo && ava && tsd","test":"tsd"}}},"_id":"@cjser/supports-color__v9_4_0@9.4.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-MIvKNn7Z4YBwkuLnRcN89nCmC4JHNYsHPp8My0j1pGBzso9ouny3WuOiqbH/gkE7ECMMQQz5TBKCdnZpgT5vuQ==","shasum":"1f7ce1127f6841b9493becdf1dcc811c9869f878","tarball":"https://registry.npmjs.org/@cjser/supports-color__v9_4_0/-/supports-color__v9_4_0-9.4.0-cjser.2.tgz","fileCount":8,"unpackedSize":13376,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDICov4eOvPro6CoyQL24sLvsc57LF2XfVoN23FjVZmdwIhAK5eSHOSbWqx2bB/Ypdhu1QIkcL4eBM3dT60J8k1FAA/"}]},"_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-color__v9_4_0_9.4.0-cjser.2_1778160282870_0.9631541653741726"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:24:42.791Z","9.4.0-cjser.2":"2026-05-07T13:24:43.024Z","modified":"2026-05-07T13:24:43.227Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Detect whether a terminal supports color","keywords":["color","colour","colors","terminal","console","cli","ansi","styles","tty","rgb","256","shell","xterm","command-line","support","supports","capability","detect","truecolor","16m"],"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-color\n\n> Detect whether a terminal supports color\n\n## Install\n\n```\n$ npm install supports-color\n```\n\n## Usage\n\n```js\nimport supportsColor from 'supports-color';\n\nif (supportsColor.stdout) {\n\tconsole.log('Terminal stdout supports color');\n}\n\nif (supportsColor.stdout.has256) {\n\tconsole.log('Terminal stdout supports 256 colors');\n}\n\nif (supportsColor.stderr.has16m) {\n\tconsole.log('Terminal stderr supports 16 million colors (truecolor)');\n}\n```\n\n## API\n\nReturns an `object` with a `stdout` and `stderr` property for testing either streams. Each property is an `Object`, or `false` if color is not supported.\n\nThe `stdout`/`stderr` objects specifies a level of support for color through a `.level` property and a corresponding flag:\n\n- `.level = 1` and `.hasBasic = true`: Basic color support (16 colors)\n- `.level = 2` and `.has256 = true`: 256 color support\n- `.level = 3` and `.has16m = true`: Truecolor support (16 million colors)\n\n### Custom instance\n\nThe package also exposes the named export `createSupportColor` function that takes an arbitrary write stream (for example, `process.stdout`) and an optional options object to (re-)evaluate color support for an arbitrary stream.\n\n```js\nimport {createSupportsColor} from 'supports-color';\n\nconst stdoutSupportsColor = createSupportsColor(process.stdout);\n\nif (stdoutSupportsColor) {\n\tconsole.log('Terminal stdout supports color');\n}\n\n// `stdoutSupportsColor` is the same as `supportsColor.stdout`\n```\n\nThe options object supports a single boolean property `sniffFlags`. By default it is `true`, which instructs the detection to sniff `process.argv` for the multitude of `--color` flags (see _Info_ below). If `false`, then `process.argv` is not considered when determining color support.\n\n## Info\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, use the environment variable `FORCE_COLOR=1` (level 1), `FORCE_COLOR=2` (level 2), or `FORCE_COLOR=3` (level 3) to forcefully enable color, or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks.\n\nExplicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively.\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n- [is-unicode-supported](https://github.com/sindresorhus/is-unicode-supported) - Detect whether the terminal supports Unicode\n- [is-interactive](https://github.com/sindresorhus/is-interactive) - Check if stdout or stderr is interactive\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Josh Junon](https://github.com/qix-)\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-supports-color?utm_source=npm-supports-color&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n\n---\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/chalk/supports-color\n","readmeFilename":"readme.md","_rev":"1-917643685b1e28be2c61093f163e495a"}