@visulima/is-ansi-color-supported 3.0.0-alpha.8 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,196 @@
1
+ ## @visulima/is-ansi-color-supported [3.0.0](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.3.5...@visulima/is-ansi-color-supported@3.0.0) (2026-07-03)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * the listed packages no longer publish a CommonJS build —
6
+ consumers must use ESM (import) or dynamic import(). @visulima/connect,
7
+ @visulima/crud, @visulima/prisma-dmmf-transformer and @visulima/api-platform
8
+ are removed and deprecated.
9
+
10
+ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
11
+ * change min node version to 22.13
12
+
13
+ ### Features
14
+
15
+ * **web:** auto-generate packages page from workspace metadata ([623e520](https://github.com/visulima/visulima/commit/623e5207693a7fe720f5f2f179593a3654c880e3))
16
+
17
+ ### Bug Fixes
18
+
19
+ * add new package image, fixed readme rendering on npm, fixed building of packages ([b790ba2](https://github.com/visulima/visulima/commit/b790ba253ea07fef83528fd822a678facf021b5f))
20
+ * **is-ansi-color-supported:** 2 bug fixes ([0e1fd0c](https://github.com/visulima/visulima/commit/0e1fd0cba80160781b8136d44506afd7f3219dd8))
21
+ * **is-ansi-color-supported:** add node types for process global ([ac91525](https://github.com/visulima/visulima/commit/ac915251cb0390ca930c2ffef42cf20be98231b8))
22
+ * **is-ansi-color-supported:** correct release method property type ([a7b940c](https://github.com/visulima/visulima/commit/a7b940c78590c65ea141d5be671383695e85c44e))
23
+ * **is-ansi-color-supported:** lazily resolve os.release to avoid bundler getBuiltinModule shim crash ([8c551ad](https://github.com/visulima/visulima/commit/8c551ada86b1164b143faf144602bb5602e6a784))
24
+ * **is-ansi-color-supported:** repair windows detection and add createIsColorSupported ([b6a4706](https://github.com/visulima/visulima/commit/b6a470628045a895ecafdca004de7f374e9ee07b))
25
+ * **is-ansi-color-supported:** resolve eslint errors ([0dc2a10](https://github.com/visulima/visulima/commit/0dc2a10efb727473fa108979c6171098a3cefacb))
26
+ * **is-ansi-color-supported:** update package files ([83a7a52](https://github.com/visulima/visulima/commit/83a7a52760135c66ea5275df5b5de05841f094bb))
27
+ * **is-ansi-color-supported:** update packem to 2.0.0-alpha.54 ([1ca2c4c](https://github.com/visulima/visulima/commit/1ca2c4c8b8f316a6e77aad1f8569ec4b9dae51b0))
28
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
29
+ * resolve failing tests across multiple packages ([2b4b6f0](https://github.com/visulima/visulima/commit/2b4b6f04169b60fdc4cf77b293015436a272c0fb))
30
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
31
+ * **terminal:** resolve eslint and formatting issues ([8f30389](https://github.com/visulima/visulima/commit/8f30389deb9ff81e7afce0aa064ef11fcb179f23))
32
+ * update Node.js engine version requirement to >=22.13 in multiple package.json files for improved compatibility ([b828e9a](https://github.com/visulima/visulima/commit/b828e9aeaebfc798eecddccd90e6ec7560c6d36a))
33
+ * update package OG images across multiple packages ([f08e4dd](https://github.com/visulima/visulima/commit/f08e4dd2b105ccb29c8412020a9c2be36d6c1e9e))
34
+ * **web:** improve build setup with incremental stats caching and prod install ([fe33e75](https://github.com/visulima/visulima/commit/fe33e75827586779b4b3a0c6d57b39f889ee6207))
35
+
36
+ ### Documentation
37
+
38
+ * **boxen,command-line-args,tabular,is-ansi-color-supported,disposable-email-domains:** add comprehensive Fumadocs documentation ([95e0578](https://github.com/visulima/visulima/commit/95e057833978dfeeb9f2768269e36862572539db))
39
+ * prettier-format agent instructions ([71b6414](https://github.com/visulima/visulima/commit/71b6414528780ac82c4e0bb25b5f4f11faba5549))
40
+
41
+ ### Miscellaneous Chores
42
+
43
+ * add fallow code-intelligence across all packages ([a3b4821](https://github.com/visulima/visulima/commit/a3b48215002e86fed20f2973038b5d4a0aa1ce04))
44
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
45
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
46
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
47
+ * fixed project.json names and schema path ([964722f](https://github.com/visulima/visulima/commit/964722f691db205c7edb9aa6db29e849a647500b))
48
+ * **is-ansi-color-supported:** add tsconfig.eslint.json for type-aware linting ([81cc05a](https://github.com/visulima/visulima/commit/81cc05abf7ef84398d8b90816f9802580ca3a639))
49
+ * **is-ansi-color-supported:** apply prettier formatting ([9efa94d](https://github.com/visulima/visulima/commit/9efa94d0a4f392857665ffc010e41f86a92d3dc0))
50
+ * **is-ansi-color-supported:** housekeeping cleanup ([b47f21c](https://github.com/visulima/visulima/commit/b47f21c5b55a7b976d9cfc052657b740ae57a142))
51
+ * **is-ansi-color-supported:** migrate .prettierrc.cjs to prettier.config.js ([b25b9c9](https://github.com/visulima/visulima/commit/b25b9c9c4858f6c562b4952eb6d0862b56de98b6))
52
+ * **is-ansi-color-supported:** migrate deps to pnpm catalogs ([426b1cc](https://github.com/visulima/visulima/commit/426b1cc246a502c29180d2340ef2f1edc4e345dd))
53
+ * **is-ansi-color-supported:** update dependencies ([9e61102](https://github.com/visulima/visulima/commit/9e61102fda7078094f88f9ccadd2965ad7816231))
54
+ * **is-ansi-color-supported:** update dependencies ([624b623](https://github.com/visulima/visulima/commit/624b623b5aec3d7b159a2779553e5dd8667e9ff9))
55
+ * **is-ansi-color-supported:** update dependencies ([92c254e](https://github.com/visulima/visulima/commit/92c254e8773e1b5b8daaa50e206a1330f4de2c90))
56
+ * **is-ansi-color-supported:** upgrade packem to 2.0.0-alpha.76 ([9bdb5a9](https://github.com/visulima/visulima/commit/9bdb5a93391c5af6536b09ac4baf6af92785e8ce))
57
+ * moved all packages into groups ([0615e9d](https://github.com/visulima/visulima/commit/0615e9d14a8a886e11da529ce150cf31ca973c10))
58
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
59
+ * refresh generated license bundles and disposable-domain stats ([a389f38](https://github.com/visulima/visulima/commit/a389f38484788aafa8ba9b698e2dd5805a982d98))
60
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.1 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.1](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@2.3.5...@visulima/is-ansi-color-supported@3.0.0-alpha.1) (2025-12-04) ([a017246](https://github.com/visulima/visulima/commit/a017246f2994a8b829e534d06b50f008af519fa4))
61
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.10 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.9...@visulima/is-ansi-color-supported@3.0.0-alpha.10) (2026-04-22) ([3627ff4](https://github.com/visulima/visulima/commit/3627ff4091f597cc9102b9dccdab8a5aa9d203de))
62
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.11 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.10...@visulima/is-ansi-color-supported@3.0.0-alpha.11) (2026-05-27) ([36bef2c](https://github.com/visulima/visulima/commit/36bef2c8610eb7627dd44595803fb3c37f47f409))
63
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.12 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.11...@visulima/is-ansi-color-supported@3.0.0-alpha.12) (2026-06-04) ([dbacabe](https://github.com/visulima/visulima/commit/dbacabeb68f4b5a64cb1aa931bc379429cd20ee2))
64
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.13 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.12...@visulima/is-ansi-color-supported@3.0.0-alpha.13) (2026-06-13) ([1b2cdc4](https://github.com/visulima/visulima/commit/1b2cdc49a4f358f515962262cfd7c587fe47f9d9))
65
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.14 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.13...@visulima/is-ansi-color-supported@3.0.0-alpha.14) (2026-06-30) ([881e227](https://github.com/visulima/visulima/commit/881e22789ca9e0240b106ca51662d488382868c3))
66
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.2 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.2](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.1...@visulima/is-ansi-color-supported@3.0.0-alpha.2) (2025-12-06) ([666fdd3](https://github.com/visulima/visulima/commit/666fdd37659aba4cb6a4be12dcb8e6ff2956c38e))
67
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.3 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.3](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.2...@visulima/is-ansi-color-supported@3.0.0-alpha.3) (2025-12-11) ([7dbfc05](https://github.com/visulima/visulima/commit/7dbfc05f1e59a4c5b806f8244aad2a2c0a5ad2b4))
68
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.4 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.4](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.3...@visulima/is-ansi-color-supported@3.0.0-alpha.4) (2025-12-27) ([41132d8](https://github.com/visulima/visulima/commit/41132d87860ae0d85caecf938e8326058e560811))
69
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.5 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.5](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.4...@visulima/is-ansi-color-supported@3.0.0-alpha.5) (2026-03-06) ([602a6d0](https://github.com/visulima/visulima/commit/602a6d0528597f47a1add72f485a91d4d7b23e95))
70
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.6 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.6](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.5...@visulima/is-ansi-color-supported@3.0.0-alpha.6) (2026-03-26) ([0f077d4](https://github.com/visulima/visulima/commit/0f077d48700662f35055ab3bb7e1386576787c72))
71
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.7 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.7](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.6...@visulima/is-ansi-color-supported@3.0.0-alpha.7) (2026-03-26) ([6dc6cef](https://github.com/visulima/visulima/commit/6dc6cef5dbc7be9d8b7cbd7a2ef9f65b69c54e7c))
72
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.8 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.7...@visulima/is-ansi-color-supported@3.0.0-alpha.8) (2026-04-08) ([90b54ca](https://github.com/visulima/visulima/commit/90b54cac0feeac39563fdaa33ebef5d77b07cbde))
73
+ * **release:** @visulima/is-ansi-color-supported@3.0.0-alpha.9 [skip ci]\n\n## @visulima/is-ansi-color-supported [3.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.8...@visulima/is-ansi-color-supported@3.0.0-alpha.9) (2026-04-15) ([167e4a3](https://github.com/visulima/visulima/commit/167e4a3069e3907745cbf32e5f8a03abb34dd96c))
74
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
75
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
76
+ * **terminal:** remove empty dependency objects from package.json ([562c704](https://github.com/visulima/visulima/commit/562c704e5d90aa2d13eae942ebbdcfeb787c2b46))
77
+ * **terminal:** update dependencies ([a5bb91a](https://github.com/visulima/visulima/commit/a5bb91a66f2be2ade485d586156a54c347a23cc9))
78
+ * update @anolilab/semantic-release-pnpm and @anolilab/semantic-release-preset to versions 3.2.2 and 12.1.2 across multiple package.json files for improved compatibility ([3921626](https://github.com/visulima/visulima/commit/3921626141fe5da398749bf0ba675f1596f18afb))
79
+ * update dependencies across multiple packages to improve compatibility and performance, including upgrading `@anolilab/semantic-release-pnpm` and `@anolilab/semantic-release-preset` to versions 3.2.0 and 12.1.0 respectively, and updating `react`, `react-dom`, and `next` versions to 19.2.1 and 16.0.7 in various package.json files ([aee8fcd](https://github.com/visulima/visulima/commit/aee8fcd796ae9b8d055903260e7150996ea9f53d))
80
+ * update homepage URLs to visulima.com/packages/ format ([be42968](https://github.com/visulima/visulima/commit/be42968129df85fb074224435e33135ff44cab91))
81
+ * update lock file maintenance ([d83e716](https://github.com/visulima/visulima/commit/d83e71697b75d24704185b66bb521a934d2db02d))
82
+ * visulima website ([#591](https://github.com/visulima/visulima/issues/591)) ([59ab2e2](https://github.com/visulima/visulima/commit/59ab2e2befb03e51cd2088956f83d9b87de6d033))
83
+ * year update ([47f4105](https://github.com/visulima/visulima/commit/47f410596ce7190cfea36a073db32e0cec50bbcd))
84
+
85
+ ### Code Refactoring
86
+
87
+ * ship esm-only; remove deprecated api packages ([6e58351](https://github.com/visulima/visulima/commit/6e58351e73ac7d8f8ec88be4d77871e4de5d5405))
88
+
89
+ ### Tests
90
+
91
+ * **is-ansi-color-supported:** cover edge-light runtime, browser userAgentData, and server ci/term paths ([8633292](https://github.com/visulima/visulima/commit/863329255aaa41530e741808b197bebd8f63b70d))
92
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
93
+
94
+ ### Build System
95
+
96
+ * emit .js instead of .mjs for esm output ([c8a6026](https://github.com/visulima/visulima/commit/c8a602665a59f0441a61a5a510cdfed9353101e6))
97
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
98
+
99
+ ### Continuous Integration
100
+
101
+ * **fallow:** make fallow:health advisory (--report-only) ([d57148e](https://github.com/visulima/visulima/commit/d57148ea0e3556b4c24d8d336b9fa14987f5dc7d))
102
+
103
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.14](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.13...@visulima/is-ansi-color-supported@3.0.0-alpha.14) (2026-06-30)
104
+
105
+ ### ⚠ BREAKING CHANGES
106
+
107
+ * the listed packages no longer publish a CommonJS build —
108
+ consumers must use ESM (import) or dynamic import(). @visulima/connect,
109
+ @visulima/crud, @visulima/prisma-dmmf-transformer and @visulima/api-platform
110
+ are removed and deprecated.
111
+
112
+ Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
113
+
114
+ ### Miscellaneous Chores
115
+
116
+ * add fallow code-intelligence across all packages ([a3b4821](https://github.com/visulima/visulima/commit/a3b48215002e86fed20f2973038b5d4a0aa1ce04))
117
+
118
+ ### Code Refactoring
119
+
120
+ * ship esm-only; remove deprecated api packages ([6e58351](https://github.com/visulima/visulima/commit/6e58351e73ac7d8f8ec88be4d77871e4de5d5405))
121
+
122
+ ### Build System
123
+
124
+ * emit .js instead of .mjs for esm output ([c8a6026](https://github.com/visulima/visulima/commit/c8a602665a59f0441a61a5a510cdfed9353101e6))
125
+
126
+ ### Continuous Integration
127
+
128
+ * **fallow:** make fallow:health advisory (--report-only) ([d57148e](https://github.com/visulima/visulima/commit/d57148ea0e3556b4c24d8d336b9fa14987f5dc7d))
129
+
130
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.13](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.12...@visulima/is-ansi-color-supported@3.0.0-alpha.13) (2026-06-13)
131
+
132
+ ### Bug Fixes
133
+
134
+ * **is-ansi-color-supported:** correct release method property type ([a7b940c](https://github.com/visulima/visulima/commit/a7b940c78590c65ea141d5be671383695e85c44e))
135
+ * **is-ansi-color-supported:** lazily resolve os.release to avoid bundler getBuiltinModule shim crash ([8c551ad](https://github.com/visulima/visulima/commit/8c551ada86b1164b143faf144602bb5602e6a784))
136
+ * **is-ansi-color-supported:** repair windows detection and add createIsColorSupported ([b6a4706](https://github.com/visulima/visulima/commit/b6a470628045a895ecafdca004de7f374e9ee07b))
137
+
138
+ ### Build System
139
+
140
+ * regenerate bundled-license manifests and types ordering ([af26588](https://github.com/visulima/visulima/commit/af26588d75aaa937fd4862800560bd4070a4878c))
141
+
142
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.12](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.11...@visulima/is-ansi-color-supported@3.0.0-alpha.12) (2026-06-04)
143
+
144
+ ### Bug Fixes
145
+
146
+ * **is-ansi-color-supported:** 2 bug fixes ([0e1fd0c](https://github.com/visulima/visulima/commit/0e1fd0cba80160781b8136d44506afd7f3219dd8))
147
+
148
+ ### Tests
149
+
150
+ * **is-ansi-color-supported:** cover edge-light runtime, browser userAgentData, and server ci/term paths ([8633292](https://github.com/visulima/visulima/commit/863329255aaa41530e741808b197bebd8f63b70d))
151
+
152
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.11](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.10...@visulima/is-ansi-color-supported@3.0.0-alpha.11) (2026-05-27)
153
+
154
+ ### Bug Fixes
155
+
156
+ * **storage-client:** percent-encode user fields in defaultFingerprint ([7c78a0f](https://github.com/visulima/visulima/commit/7c78a0f9512e2a673b941d80839e9f1e86b7b5d0))
157
+
158
+ ### Documentation
159
+
160
+ * prettier-format agent instructions ([71b6414](https://github.com/visulima/visulima/commit/71b6414528780ac82c4e0bb25b5f4f11faba5549))
161
+
162
+ ### Miscellaneous Chores
163
+
164
+ * **ci-stability:** green CI across vis, native, lint, tests, attw ([#651](https://github.com/visulima/visulima/issues/651)) ([d4eb684](https://github.com/visulima/visulima/commit/d4eb684b5f75c818c9251048c605a0ed54a268e3))
165
+ * **is-ansi-color-supported:** housekeeping cleanup ([b47f21c](https://github.com/visulima/visulima/commit/b47f21c5b55a7b976d9cfc052657b740ae57a142))
166
+ * **is-ansi-color-supported:** upgrade packem to 2.0.0-alpha.76 ([9bdb5a9](https://github.com/visulima/visulima/commit/9bdb5a93391c5af6536b09ac4baf6af92785e8ce))
167
+ * re-sort workspace package.json files via vis sort-package-json ([f625696](https://github.com/visulima/visulima/commit/f625696cfac974325774b3243e1a83c3d23acbd7))
168
+ * refresh generated license bundles and disposable-domain stats ([a389f38](https://github.com/visulima/visulima/commit/a389f38484788aafa8ba9b698e2dd5805a982d98))
169
+ * **repo:** sort package.json keys across all packages ([e1fd9ab](https://github.com/visulima/visulima/commit/e1fd9ab467ef96a98c777da1572ff6a50fcf7e71))
170
+ * sorted package.json ([b47c545](https://github.com/visulima/visulima/commit/b47c545591600fdab17d5cd3a3fbc68b61e199da))
171
+
172
+ ### Tests
173
+
174
+ * **repo:** add dist runtime + types integration tests ([32ee300](https://github.com/visulima/visulima/commit/32ee300b7184117a0ddf9f9d390f75f8932d5ed9))
175
+
176
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.10](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.9...@visulima/is-ansi-color-supported@3.0.0-alpha.10) (2026-04-22)
177
+
178
+ ### Bug Fixes
179
+
180
+ * Remove JSR configuration generation script and generated jsr.json files ([#616](https://github.com/visulima/visulima/issues/616)) ([533744b](https://github.com/visulima/visulima/commit/533744b103b74896941db5b727173e617a27a63b))
181
+
182
+ ### Miscellaneous Chores
183
+
184
+ * bump engines.node to ^22.14.0 || >=24.10.0 ([c3d0931](https://github.com/visulima/visulima/commit/c3d0931d1504e4f21ebf50ea680cfa7ce4ba15ce))
185
+ * fixed jsr.json ([5d85e51](https://github.com/visulima/visulima/commit/5d85e5179de38e284ec433b14d77c71a1619c8d6))
186
+
187
+ ## @visulima/is-ansi-color-supported [3.0.0-alpha.9](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.8...@visulima/is-ansi-color-supported@3.0.0-alpha.9) (2026-04-15)
188
+
189
+ ### Bug Fixes
190
+
191
+ * **is-ansi-color-supported:** add node types for process global ([ac91525](https://github.com/visulima/visulima/commit/ac915251cb0390ca930c2ffef42cf20be98231b8))
192
+ * **terminal:** resolve eslint and formatting issues ([8f30389](https://github.com/visulima/visulima/commit/8f30389deb9ff81e7afce0aa064ef11fcb179f23))
193
+
1
194
  ## @visulima/is-ansi-color-supported [3.0.0-alpha.8](https://github.com/visulima/visulima/compare/@visulima/is-ansi-color-supported@3.0.0-alpha.7...@visulima/is-ansi-color-supported@3.0.0-alpha.8) (2026-04-08)
2
195
 
3
196
  ### Bug Fixes
package/README.md CHANGED
@@ -65,9 +65,29 @@ console.log(isStdoutColorSupported()); // 3
65
65
  console.log(isStderrColorSupported()); // 3
66
66
  ```
67
67
 
68
+ ### Custom detection (`createIsColorSupported`)
69
+
70
+ For library authors who need more control, `createIsColorSupported` lets you pick the
71
+ stream, disable CLI flag sniffing, or force the TTY state:
72
+
73
+ ```typescript
74
+ import { createIsColorSupported } from "@visulima/is-ansi-color-supported";
75
+
76
+ // Detect stdout color support without inspecting `process.argv`
77
+ // (useful when your CLI defines its own `--color` semantics):
78
+ const level = createIsColorSupported("stdout", { sniffFlags: false });
79
+
80
+ // Probe stderr while forcing the TTY state (e.g. when writing to a log file):
81
+ const stderrLevel = createIsColorSupported("stderr", { isTTY: false });
82
+ ```
83
+
84
+ > The `browser` and `edge-light` builds also export `createIsColorSupported` for API
85
+ > parity, but ignore the `stream`/`options` arguments (those runtimes have no streams,
86
+ > CLI args, `tty`, or `os`).
87
+
68
88
  ## Color support
69
89
 
70
- Ansis automatically detects the supported color space:
90
+ This package automatically detects the supported color space:
71
91
 
72
92
  - TrueColor
73
93
  - ANSI 256 colors
@@ -114,8 +134,13 @@ The value is not important, e.g., `NO_COLOR=1` `NO_COLOR=true` disable colors.
114
134
  See standard description by [NO_COLOR](https://no-color.org/).
115
135
 
116
136
  The `FORCE_COLOR` variable should be presents with one of values:\
117
- `FORCE_COLOR=0` force disable colors\
118
- `FORCE_COLOR=1` force enable colors
137
+ `FORCE_COLOR=0` (or `FORCE_COLOR=false`) force disable colors\
138
+ `FORCE_COLOR=1`, `2`, `3` (or `FORCE_COLOR=true`) force enable colors at the given level
139
+
140
+ When `FORCE_COLOR` requests color (any value other than `0`/`false`) it takes precedence over the
141
+ `NO_COLOR` environment variable, so `FORCE_COLOR=true NO_COLOR=1` and `FORCE_COLOR=1 NO_COLOR=1` both
142
+ enable colors. The `--no-color` CLI flag still wins over everything, since command-line arguments have
143
+ the highest priority.
119
144
 
120
145
  ## CLI arguments
121
146
 
@@ -146,6 +171,12 @@ $ ./colors.js --color=true > log.txt # output in file with ANSI codes
146
171
  >
147
172
  > The command line arguments have a higher priority than environment variable.
148
173
 
174
+ > **Note**
175
+ >
176
+ > A 256-color `TERM` (e.g. `TERM=xterm-256color`) reports level `2` even when the output is piped
177
+ > to a file and not a TTY. This is intentional (ansis-style behaviour). If you need supports-color's
178
+ > stricter TTY-first gating, use `createIsColorSupported("stdout", { isTTY: false })`.
179
+
149
180
  ## Info
150
181
 
151
182
  For 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.
@@ -1,5 +1,44 @@
1
- import type { ColorSupportLevel } from "./types.d.ts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.ts";
5
- export type { ColorSupportLevel } from "./types.d.ts";
1
+ /**
2
+ * Levels:
3
+ * - `0` - All colors disabled.
4
+ * - `1` - Basic 16 colors support.
5
+ * - `2` - ANSI 256 colors support.
6
+ * - `3` - Truecolor 16 million colors support.
7
+ */
8
+ type ColorSupportLevel = 0 | 1 | 2 | 3;
9
+ /**
10
+ * Options for the configurable `createIsColorSupported` detector.
11
+ */
12
+ interface CreateIsColorSupportedOptions {
13
+ /**
14
+ * Force the TTY state instead of reading it from the resolved stream.
15
+ *
16
+ * Useful when probing color support for a non-standard sink (e.g. a log file)
17
+ * or when the runtime does not expose `isTTY`. When omitted, the stream's own
18
+ * `isTTY` (or Deno's `isTerminal()`) is used.
19
+ */
20
+ isTTY?: boolean;
21
+ /**
22
+ * Whether to inspect `process.argv` for `--color`/`--no-color`-style flags.
23
+ *
24
+ * Set to `false` for library consumers whose CLIs define their own `--color`
25
+ * semantics, so the detector does not react to unrelated flags.
26
+ * @default true
27
+ */
28
+ sniffFlags?: boolean;
29
+ }
30
+ declare const SPACE_MONO = 0;
31
+ declare const SPACE_16_COLORS = 1;
32
+ declare const SPACE_256_COLORS = 2;
33
+ declare const SPACE_TRUE_COLORS = 3;
34
+ declare const isStdoutColorSupported: () => ColorSupportLevel;
35
+ declare const isStderrColorSupported: () => ColorSupportLevel;
36
+ /**
37
+ * Browser equivalent of the server `createIsColorSupported`.
38
+ *
39
+ * The browser runtime cannot inspect a process' streams or CLI flags, so the
40
+ * `stream` argument and options are accepted for API parity but ignored.
41
+ * @returns The detected {@link ColorSupportLevel}.
42
+ */
43
+ declare const createIsColorSupported: (_stream?: "stderr" | "stdout", _options?: CreateIsColorSupportedOptions) => ColorSupportLevel;
44
+ export { type ColorSupportLevel, type CreateIsColorSupportedOptions, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, createIsColorSupported, isStderrColorSupported, isStdoutColorSupported };
@@ -0,0 +1 @@
1
+ import{SPACE_TRUE_COLORS as e,SPACE_16_COLORS as n,SPACE_MONO as a}from"./packem_shared/SPACE_16_COLORS-BEQbKWNs.js";import{SPACE_256_COLORS as d}from"./packem_shared/SPACE_16_COLORS-BEQbKWNs.js";const i=/\b(Chrome|Chromium)\//,r=()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const t=navigator.userAgentData.brands.find(o=>o.brand==="Chromium");if(Number(t?.version)>93)return e}if(i.test(navigator.userAgent))return n}return a})(),C=r,s=r,S=(t,o)=>r();export{n as SPACE_16_COLORS,d as SPACE_256_COLORS,a as SPACE_MONO,e as SPACE_TRUE_COLORS,S as createIsColorSupported,s as isStderrColorSupported,C as isStdoutColorSupported};
@@ -1,5 +1,44 @@
1
- import type { ColorSupportLevel } from "./types.d.ts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.ts";
5
- export type { ColorSupportLevel } from "./types.d.ts";
1
+ /**
2
+ * Levels:
3
+ * - `0` - All colors disabled.
4
+ * - `1` - Basic 16 colors support.
5
+ * - `2` - ANSI 256 colors support.
6
+ * - `3` - Truecolor 16 million colors support.
7
+ */
8
+ type ColorSupportLevel = 0 | 1 | 2 | 3;
9
+ /**
10
+ * Options for the configurable `createIsColorSupported` detector.
11
+ */
12
+ interface CreateIsColorSupportedOptions {
13
+ /**
14
+ * Force the TTY state instead of reading it from the resolved stream.
15
+ *
16
+ * Useful when probing color support for a non-standard sink (e.g. a log file)
17
+ * or when the runtime does not expose `isTTY`. When omitted, the stream's own
18
+ * `isTTY` (or Deno's `isTerminal()`) is used.
19
+ */
20
+ isTTY?: boolean;
21
+ /**
22
+ * Whether to inspect `process.argv` for `--color`/`--no-color`-style flags.
23
+ *
24
+ * Set to `false` for library consumers whose CLIs define their own `--color`
25
+ * semantics, so the detector does not react to unrelated flags.
26
+ * @default true
27
+ */
28
+ sniffFlags?: boolean;
29
+ }
30
+ declare const SPACE_MONO = 0;
31
+ declare const SPACE_16_COLORS = 1;
32
+ declare const SPACE_256_COLORS = 2;
33
+ declare const SPACE_TRUE_COLORS = 3;
34
+ declare const isStdoutColorSupported: () => ColorSupportLevel;
35
+ declare const isStderrColorSupported: () => ColorSupportLevel;
36
+ /**
37
+ * Edge-runtime equivalent of the server `createIsColorSupported`.
38
+ *
39
+ * The edge runtime has no `tty`/`os`, so the `stream` argument and options are
40
+ * accepted for API parity but ignored.
41
+ * @returns The detected {@link ColorSupportLevel}.
42
+ */
43
+ declare const createIsColorSupported: (_stream?: "stderr" | "stdout", _options?: CreateIsColorSupportedOptions) => ColorSupportLevel;
44
+ export { type ColorSupportLevel, type CreateIsColorSupportedOptions, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, createIsColorSupported, isStderrColorSupported, isStdoutColorSupported };
@@ -0,0 +1 @@
1
+ import{SPACE_TRUE_COLORS as n,SPACE_16_COLORS as e,SPACE_MONO as s}from"./packem_shared/SPACE_16_COLORS-BEQbKWNs.js";import{SPACE_256_COLORS as f}from"./packem_shared/SPACE_16_COLORS-BEQbKWNs.js";const i=/\b(Chrome|Chromium)\//,u=()=>(()=>{if(typeof navigator<"u"){if(navigator.userAgentData){const o=navigator.userAgentData.brands.find(t=>t.brand==="Chromium");if(Number(o?.version)>93)return n}if(i.test(navigator.userAgent))return e}return s})(),a=u,r=()=>process.env.NEXT_RUNTIME?.includes("edge")?e:a(),C=r,S=r,d=(o,t)=>r();export{e as SPACE_16_COLORS,f as SPACE_256_COLORS,s as SPACE_MONO,n as SPACE_TRUE_COLORS,d as createIsColorSupported,S as isStderrColorSupported,C as isStdoutColorSupported};
@@ -1,5 +1,66 @@
1
- import type { ColorSupportLevel } from "./types.d.ts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.ts";
5
- export type { ColorSupportLevel } from "./types.d.ts";
1
+ /**
2
+ * Levels:
3
+ * - `0` - All colors disabled.
4
+ * - `1` - Basic 16 colors support.
5
+ * - `2` - ANSI 256 colors support.
6
+ * - `3` - Truecolor 16 million colors support.
7
+ */
8
+ type ColorSupportLevel = 0 | 1 | 2 | 3;
9
+ /**
10
+ * Options for the configurable `createIsColorSupported` detector.
11
+ */
12
+ interface CreateIsColorSupportedOptions {
13
+ /**
14
+ * Force the TTY state instead of reading it from the resolved stream.
15
+ *
16
+ * Useful when probing color support for a non-standard sink (e.g. a log file)
17
+ * or when the runtime does not expose `isTTY`. When omitted, the stream's own
18
+ * `isTTY` (or Deno's `isTerminal()`) is used.
19
+ */
20
+ isTTY?: boolean;
21
+ /**
22
+ * Whether to inspect `process.argv` for `--color`/`--no-color`-style flags.
23
+ *
24
+ * Set to `false` for library consumers whose CLIs define their own `--color`
25
+ * semantics, so the detector does not react to unrelated flags.
26
+ * @default true
27
+ */
28
+ sniffFlags?: boolean;
29
+ }
30
+ declare const SPACE_MONO = 0;
31
+ declare const SPACE_16_COLORS = 1;
32
+ declare const SPACE_256_COLORS = 2;
33
+ declare const SPACE_TRUE_COLORS = 3;
34
+ /**
35
+ * Detect the ANSI color-support level of the current process' **stdout** stream.
36
+ *
37
+ * Honors `FORCE_COLOR`/`NO_COLOR`, `--color`/`--no-color`/`--color=256`/`--color=16m` CLI flags,
38
+ * CI providers, `TERM`/`COLORTERM`, terminal emulators and Windows build numbers.
39
+ * @returns The detected {@link ColorSupportLevel} (`0` none, `1` 16-color, `2` 256-color, `3` truecolor).
40
+ */
41
+ declare const isStdoutColorSupported: () => ColorSupportLevel;
42
+ /**
43
+ * Detect the ANSI color-support level of the current process' **stderr** stream.
44
+ *
45
+ * Useful because stdout and stderr can have different TTY capabilities (e.g. `node app > out.txt`).
46
+ * @returns The detected {@link ColorSupportLevel} (`0` none, `1` 16-color, `2` 256-color, `3` truecolor).
47
+ */
48
+ declare const isStderrColorSupported: () => ColorSupportLevel;
49
+ /**
50
+ * Create a color-support detector for a specific standard stream with custom options.
51
+ *
52
+ * This is the configurable equivalent of {@link isStdoutColorSupported} /
53
+ * {@link isStderrColorSupported}. It lets library consumers disable CLI flag sniffing
54
+ * (`sniffFlags: false`) when their CLI defines its own `--color` semantics, or force the
55
+ * TTY state (`isTTY`) when probing for a non-standard sink such as a log file.
56
+ * @param stream Which standard stream to probe: `"stdout"` (default) or `"stderr"`.
57
+ * @param options Detection options.
58
+ * @returns The detected {@link ColorSupportLevel}.
59
+ * @example
60
+ * ```ts
61
+ * // Detect stdout color support without inspecting `process.argv`:
62
+ * const level = createIsColorSupported("stdout", { sniffFlags: false });
63
+ * ```
64
+ */
65
+ declare const createIsColorSupported: (stream?: "stderr" | "stdout", options?: CreateIsColorSupportedOptions) => ColorSupportLevel;
66
+ export { type ColorSupportLevel, type CreateIsColorSupportedOptions, SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, createIsColorSupported, isStderrColorSupported, isStdoutColorSupported };
@@ -0,0 +1 @@
1
+ import{SPACE_MONO as O,SPACE_256_COLORS as T,SPACE_TRUE_COLORS as n,SPACE_16_COLORS as i}from"./packem_shared/SPACE_16_COLORS-BEQbKWNs.js";const v=/^-{1,2}(no-color|no-colors|color=false|color=never)$/,g=/^-{1,2}(color=256)$/,y=/^-{1,2}(color=16m|color=full|color=truecolor)$/,P=/^-{1,2}(color|colors|color=true|color=always)$/,h=/-mono|dumb/i,x=/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/,D=/-256(color)?$/i,G=/^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i,B=()=>{const u=globalThis.process?.getBuiltinModule;return typeof u!="function"?"":u("node:os").release()},m=(u,d={})=>{const{isTTY:M,sniffFlags:_=!0}=d,l=globalThis,R=l.Deno!=null,s=l.process??l.Deno??{},I=s.argv??s.args??[],C=_?I.indexOf("--"):-1,E=r=>{if(!_)return!1;const f=I.findIndex(b=>r.test(b));return f!==-1&&(C===-1||f<C)};let e={};try{e=R?s.env.toObject():s.env??{}}catch{}const N="FORCE_COLOR",p=N in e,o=e[N]??void 0,A=typeof o=="string",S=typeof o=="number";let t;if(o==="true")t=i;else if(o==="false")t=O;else if(A&&o.length===0)t=i;else if(A&&o.length>0){const r=Number.parseInt(o,10);t=Number.isNaN(r)?void 0:Math.min(r,3)}else S&&(t=Number.isNaN(o)?void 0:Math.min(o,3));if(o!=="true"&&o!=="false"&&t!==void 0&&t<4)return t;const L=p&&t!==void 0&&t>0;if(p&&t===0||E(v)||!L&&"NO_COLOR"in e)return O;if(E(g))return T;if(E(y))return n;if(E(P))return i;const a=t??O;if("TF_BUILD"in e&&"AGENT_NAME"in e)return i;if(e.TERM&&h.test(e.TERM))return a;if((R?l.Deno.build.os:s.platform)==="win32"){if("WT_SESSION"in e)return n;if("ANSICON"in e)return i;try{let r;R?r=l.Deno.osRelease():typeof s.os?.release=="function"?r=s.os.release():r=B();const f=r.split(".");return Number(f[0])>=10&&Number(f[2])>=10586?Number(f[2])>=14931?n:T:i}catch{}}if("CI"in e)return["GITEA_ACTIONS","CIRCLECI","GITHUB_WORKFLOW","GITHUB_ACTIONS"].some(r=>r in e)?n:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(r=>r in e)||e.CI_NAME==="codeship"?i:a;if(e.TERMINAL_EMULATOR?.includes("JediTerm"))return n;if("TEAMCITY_VERSION"in e)return x.test(e.TEAMCITY_VERSION)?i:O;if(e.COLORTERM==="truecolor")return n;if(e.TERM==="xterm-kitty")return n;if(e.TERM==="xterm-ghostty")return n;if(e.TERM==="wezterm")return n;if("TERM_PROGRAM"in e){const r=Number.parseInt((e.TERM_PROGRAM_VERSION??"").split(".")[0],10);if(e.TERM_PROGRAM==="iTerm.app")return r>=3?n:T;if(e.TERM_PROGRAM==="Apple_Terminal")return T}if(D.test(e.TERM))return T;let c;return M!==void 0?c=M:R?c=u==="out"?l.Deno.stdout.isTerminal():l.Deno.stderr.isTerminal():"PM2_HOME"in e&&"pm_id"in e?c=!0:c=!!s[`std${u}`]?.isTTY,c&&G.test(e.TERM)?i:"COLORTERM"in e?i:a},$=()=>m("out"),F=()=>m("err"),V=(u="stdout",d={})=>m(u==="stderr"?"err":"out",d);export{i as SPACE_16_COLORS,T as SPACE_256_COLORS,O as SPACE_MONO,n as SPACE_TRUE_COLORS,V as createIsColorSupported,F as isStderrColorSupported,$ as isStdoutColorSupported};
@@ -0,0 +1 @@
1
+ const O=0,C=1,S=2,_=3;export{C as SPACE_16_COLORS,S as SPACE_256_COLORS,O as SPACE_MONO,_ as SPACE_TRUE_COLORS};
package/package.json CHANGED
@@ -1,41 +1,39 @@
1
1
  {
2
2
  "name": "@visulima/is-ansi-color-supported",
3
- "version": "3.0.0-alpha.8",
3
+ "version": "3.0.0",
4
4
  "description": "Detect whether a terminal or browser supports ansi colors.",
5
5
  "keywords": [
6
+ "256",
7
+ "FORCE_COLOR",
8
+ "NO_COLOR",
6
9
  "anolilab",
7
- "visulima",
8
- "colorize",
9
10
  "ansi",
10
- "colour",
11
+ "ansi-colors",
12
+ "capability",
13
+ "cli",
11
14
  "color",
15
+ "colorize",
12
16
  "colors",
13
- "styles",
14
- "terminal",
15
- "xterm",
17
+ "colour",
18
+ "command-line",
16
19
  "console",
17
- "cli",
18
- "truecolor",
19
- "FORCE_COLOR",
20
- "NO_COLOR",
21
- "ansi-colors",
22
- "style",
23
- "tty",
24
- "256",
25
20
  "detect",
26
21
  "edge",
27
22
  "next.js",
28
23
  "nextjs",
24
+ "shell",
25
+ "style",
26
+ "styles",
29
27
  "support",
30
28
  "supports",
31
- "capability",
32
- "shell",
33
- "command-line"
29
+ "terminal",
30
+ "truecolor",
31
+ "tty",
32
+ "visulima",
33
+ "xterm"
34
34
  ],
35
35
  "homepage": "https://visulima.com/packages/is-ansi-color-supported/",
36
- "bugs": {
37
- "url": "https://github.com/visulima/visulima/issues"
38
- },
36
+ "bugs": "https://github.com/visulima/visulima/issues",
39
37
  "repository": {
40
38
  "type": "git",
41
39
  "url": "git+https://github.com/visulima/visulima.git",
@@ -61,47 +59,30 @@
61
59
  "exports": {
62
60
  ".": {
63
61
  "edge-light": {
64
- "types": "./dist/is-color-supported.edge-light.d.mts",
65
- "default": "./dist/is-color-supported.edge-light.mjs"
62
+ "types": "./dist/is-color-supported.edge-light.d.ts",
63
+ "default": "./dist/is-color-supported.edge-light.js"
66
64
  },
67
65
  "browser": {
68
- "types": "./dist/is-color-supported.browser.d.mts",
69
- "default": "./dist/is-color-supported.browser.mjs"
66
+ "types": "./dist/is-color-supported.browser.d.ts",
67
+ "default": "./dist/is-color-supported.browser.js"
70
68
  },
71
- "import": {
72
- "types": "./dist/is-color-supported.server.d.mts",
73
- "default": "./dist/is-color-supported.server.mjs"
74
- },
75
- "require": {
76
- "types": "./dist/is-color-supported.server.d.cts",
77
- "default": "./dist/is-color-supported.server.cjs"
69
+ "default": {
70
+ "types": "./dist/is-color-supported.server.d.ts",
71
+ "default": "./dist/is-color-supported.server.js"
78
72
  }
79
73
  },
80
74
  "./browser": {
81
- "import": {
82
- "types": "./dist/is-color-supported.browser.d.mts",
83
- "default": "./dist/is-color-supported.browser.mjs"
84
- },
85
- "require": {
86
- "types": "./dist/is-color-supported.browser.d.cts",
87
- "default": "./dist/is-color-supported.browser.cjs"
88
- }
75
+ "types": "./dist/is-color-supported.browser.d.ts",
76
+ "default": "./dist/is-color-supported.browser.js"
89
77
  },
90
78
  "./edge-light": {
91
- "import": {
92
- "types": "./dist/is-color-supported.edge-light.d.mts",
93
- "default": "./dist/is-color-supported.edge-light.mjs"
94
- },
95
- "require": {
96
- "types": "./dist/is-color-supported.edge-light.d.cts",
97
- "default": "./dist/is-color-supported.edge-light.cjs"
98
- }
79
+ "types": "./dist/is-color-supported.edge-light.d.ts",
80
+ "default": "./dist/is-color-supported.edge-light.js"
99
81
  },
100
82
  "./package.json": "./package.json"
101
83
  },
102
- "main": "dist/is-color-supported.server.cjs",
103
- "module": "dist/is-color-supported.server.mjs",
104
- "browser": "dist/is-color-supported.browser.mjs",
84
+ "module": "dist/is-color-supported.server.js",
85
+ "browser": "dist/is-color-supported.browser.js",
105
86
  "types": "dist/is-color-supported.server.d.ts",
106
87
  "typesVersions": {
107
88
  ">=5.0": {
@@ -125,13 +106,8 @@
125
106
  "LICENSE.md"
126
107
  ],
127
108
  "engines": {
128
- "node": ">=22.13 <=25.x"
109
+ "node": "^22.14.0 || >=24.10.0"
129
110
  },
130
- "os": [
131
- "darwin",
132
- "linux",
133
- "win32"
134
- ],
135
111
  "publishConfig": {
136
112
  "access": "public",
137
113
  "provenance": true
@@ -1,4 +0,0 @@
1
- export declare const SPACE_MONO = 0;
2
- export declare const SPACE_16_COLORS = 1;
3
- export declare const SPACE_256_COLORS = 2;
4
- export declare const SPACE_TRUE_COLORS = 3;
@@ -1,4 +0,0 @@
1
- export declare const SPACE_MONO = 0;
2
- export declare const SPACE_16_COLORS = 1;
3
- export declare const SPACE_256_COLORS = 2;
4
- export declare const SPACE_TRUE_COLORS = 3;
@@ -1,4 +0,0 @@
1
- export declare const SPACE_MONO = 0;
2
- export declare const SPACE_16_COLORS = 1;
3
- export declare const SPACE_256_COLORS = 2;
4
- export declare const SPACE_TRUE_COLORS = 3;
@@ -1,30 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
6
-
7
- const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
8
- const isColorSupported = () => (() => {
9
- if (typeof navigator !== "undefined") {
10
- if (navigator.userAgentData) {
11
- const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
12
- if (brand?.version > 93) {
13
- return SPACE_MONO.SPACE_TRUE_COLORS;
14
- }
15
- }
16
- if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
17
- return SPACE_MONO.SPACE_16_COLORS;
18
- }
19
- }
20
- return SPACE_MONO.SPACE_MONO;
21
- })();
22
- const isStdoutColorSupported = isColorSupported;
23
- const isStderrColorSupported = isColorSupported;
24
-
25
- exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
26
- exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
27
- exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
28
- exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
29
- exports.isStderrColorSupported = isStderrColorSupported;
30
- exports.isStdoutColorSupported = isStdoutColorSupported;
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.cts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.cts";
5
- export type { ColorSupportLevel } from "./types.d.cts";
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.mts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.mts";
5
- export type { ColorSupportLevel } from "./types.d.mts";
@@ -1,22 +0,0 @@
1
- import { SPACE_TRUE_COLORS, SPACE_16_COLORS, SPACE_MONO } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
2
- export { SPACE_256_COLORS } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
3
-
4
- const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
5
- const isColorSupported = () => (() => {
6
- if (typeof navigator !== "undefined") {
7
- if (navigator.userAgentData) {
8
- const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
9
- if (brand?.version > 93) {
10
- return SPACE_TRUE_COLORS;
11
- }
12
- }
13
- if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
14
- return SPACE_16_COLORS;
15
- }
16
- }
17
- return SPACE_MONO;
18
- })();
19
- const isStdoutColorSupported = isColorSupported;
20
- const isStderrColorSupported = isColorSupported;
21
-
22
- export { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
@@ -1,38 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
6
-
7
- const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
8
- const isColorSupported$1 = () => (() => {
9
- if (typeof navigator !== "undefined") {
10
- if (navigator.userAgentData) {
11
- const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
12
- if (brand?.version > 93) {
13
- return SPACE_MONO.SPACE_TRUE_COLORS;
14
- }
15
- }
16
- if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
17
- return SPACE_MONO.SPACE_16_COLORS;
18
- }
19
- }
20
- return SPACE_MONO.SPACE_MONO;
21
- })();
22
- const isStdoutColorSupported$1 = isColorSupported$1;
23
-
24
- const isColorSupported = () => (() => {
25
- if (process.env.NEXT_RUNTIME?.includes("edge")) {
26
- return SPACE_MONO.SPACE_16_COLORS;
27
- }
28
- return isStdoutColorSupported$1();
29
- })();
30
- const isStdoutColorSupported = isColorSupported;
31
- const isStderrColorSupported = isColorSupported;
32
-
33
- exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
34
- exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
35
- exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
36
- exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
37
- exports.isStderrColorSupported = isStderrColorSupported;
38
- exports.isStdoutColorSupported = isStdoutColorSupported;
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.cts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.cts";
5
- export type { ColorSupportLevel } from "./types.d.cts";
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.mts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.mts";
5
- export type { ColorSupportLevel } from "./types.d.mts";
@@ -1,30 +0,0 @@
1
- import { SPACE_TRUE_COLORS, SPACE_16_COLORS, SPACE_MONO } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
2
- export { SPACE_256_COLORS } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
3
-
4
- const CHROME_CHROMIUM_RE = /\b(Chrome|Chromium)\//;
5
- const isColorSupported$1 = () => (() => {
6
- if (typeof navigator !== "undefined") {
7
- if (navigator.userAgentData) {
8
- const brand = navigator.userAgentData.brands.find(({ b }) => b === "Chromium");
9
- if (brand?.version > 93) {
10
- return SPACE_TRUE_COLORS;
11
- }
12
- }
13
- if (CHROME_CHROMIUM_RE.test(navigator.userAgent)) {
14
- return SPACE_16_COLORS;
15
- }
16
- }
17
- return SPACE_MONO;
18
- })();
19
- const isStdoutColorSupported$1 = isColorSupported$1;
20
-
21
- const isColorSupported = () => (() => {
22
- if (process.env.NEXT_RUNTIME?.includes("edge")) {
23
- return SPACE_16_COLORS;
24
- }
25
- return isStdoutColorSupported$1();
26
- })();
27
- const isStdoutColorSupported = isColorSupported;
28
- const isStderrColorSupported = isColorSupported;
29
-
30
- export { SPACE_16_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
@@ -1,145 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const SPACE_MONO = require('./packem_shared/SPACE_MONO-Cwv43lY6.cjs');
6
-
7
- const NO_COLOR_FLAGS_RE = /^-{1,2}(no-color|no-colors|color=false|color=never)$/;
8
- const COLOR_256_FLAGS_RE = /^-{1,2}(color=256)$/;
9
- const COLOR_TRUECOLOR_FLAGS_RE = /^-{1,2}(color=16m|color=full|color=truecolor)$/;
10
- const COLOR_ENABLED_FLAGS_RE = /^-{1,2}(color|colors|color=true|color=always)$/;
11
- const DUMB_TERM_RE = /-mono|dumb/i;
12
- const TEAMCITY_RE = /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/;
13
- const TERM_256_RE = /-256(color)?$/i;
14
- const TERM_COLOR_RE = /^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i;
15
- const isColorSupportedFactory = (stdName) => {
16
- const _this = globalThis;
17
- const isDeno = _this.Deno != void 0;
18
- const proc = _this.process ?? _this.Deno ?? {};
19
- const argv = proc.argv ?? proc.args ?? [];
20
- const oneOfFlags = (regex) => {
21
- const terminatorPosition = argv.indexOf("--");
22
- const position = argv.findIndex((flag) => regex.test(flag));
23
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
24
- };
25
- let environment = {};
26
- try {
27
- environment = isDeno ? proc.env.toObject() : proc.env ?? {};
28
- } catch {
29
- }
30
- const FORCE_COLOR = "FORCE_COLOR";
31
- const hasForceColor = FORCE_COLOR in environment;
32
- const forceColorValue = environment[FORCE_COLOR] ?? void 0;
33
- const forceColorValueIsString = Object.prototype.toString.call(forceColorValue).slice(8, -1) === "String";
34
- const forceColorValueIsNumber = typeof forceColorValue === "number";
35
- let forceColor;
36
- if (forceColorValue === "true") {
37
- forceColor = SPACE_MONO.SPACE_16_COLORS;
38
- } else if (forceColorValue === "false") {
39
- forceColor = SPACE_MONO.SPACE_MONO;
40
- } else if (forceColorValueIsString && forceColorValue.length === 0) {
41
- forceColor = SPACE_MONO.SPACE_16_COLORS;
42
- } else if (forceColorValueIsString && forceColorValue.length > 0) {
43
- forceColor = Math.min(Number.parseInt(forceColorValue, 10), 3);
44
- } else if (forceColorValueIsNumber) {
45
- forceColor = Math.min(forceColorValue, 3);
46
- }
47
- if (forceColorValue !== "true" && forceColorValue !== "false" && forceColor !== void 0 && forceColor < 4) {
48
- return forceColor;
49
- }
50
- const isForceDisabled = "NO_COLOR" in environment || hasForceColor && forceColor === 0 || oneOfFlags(NO_COLOR_FLAGS_RE);
51
- if (isForceDisabled) {
52
- return SPACE_MONO.SPACE_MONO;
53
- }
54
- if (oneOfFlags(COLOR_256_FLAGS_RE)) {
55
- return SPACE_MONO.SPACE_256_COLORS;
56
- }
57
- if (oneOfFlags(COLOR_TRUECOLOR_FLAGS_RE)) {
58
- return SPACE_MONO.SPACE_TRUE_COLORS;
59
- }
60
- const isForceEnabled = oneOfFlags(COLOR_ENABLED_FLAGS_RE);
61
- if (isForceEnabled) {
62
- return SPACE_MONO.SPACE_16_COLORS;
63
- }
64
- const minColorLevel = forceColor ?? SPACE_MONO.SPACE_MONO;
65
- if ("TF_BUILD" in environment && "AGENT_NAME" in environment) {
66
- return SPACE_MONO.SPACE_16_COLORS;
67
- }
68
- const isDumbTerminal = environment.TERM && DUMB_TERM_RE.test(environment.TERM);
69
- if (isDumbTerminal) {
70
- return minColorLevel;
71
- }
72
- if ((isDeno ? _this.Deno.build.os : proc.platform) === "win32") {
73
- try {
74
- const osRelease = (isDeno ? _this.Deno.osRelease() : proc.os.release()).split(".");
75
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
76
- return Number(osRelease[2]) >= 14931 ? SPACE_MONO.SPACE_TRUE_COLORS : SPACE_MONO.SPACE_256_COLORS;
77
- }
78
- return SPACE_MONO.SPACE_16_COLORS;
79
- } catch {
80
- }
81
- }
82
- if ("CI" in environment) {
83
- if (["GITEA_ACTIONS", "CIRCLECI", "GITHUB_WORKFLOW", "GITHUB_ACTIONS"].some((sign) => sign in environment)) {
84
- return SPACE_MONO.SPACE_TRUE_COLORS;
85
- }
86
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in environment) || environment.CI_NAME === "codeship") {
87
- return SPACE_MONO.SPACE_16_COLORS;
88
- }
89
- return minColorLevel;
90
- }
91
- if (environment.TERMINAL_EMULATOR?.includes("JediTerm")) {
92
- return SPACE_MONO.SPACE_TRUE_COLORS;
93
- }
94
- if ("TEAMCITY_VERSION" in environment) {
95
- return TEAMCITY_RE.test(environment.TEAMCITY_VERSION) ? SPACE_MONO.SPACE_16_COLORS : SPACE_MONO.SPACE_MONO;
96
- }
97
- if (environment.COLORTERM === "truecolor") {
98
- return SPACE_MONO.SPACE_TRUE_COLORS;
99
- }
100
- if (environment.TERM === "xterm-kitty") {
101
- return SPACE_MONO.SPACE_TRUE_COLORS;
102
- }
103
- if (environment.TERM === "xterm-ghostty") {
104
- return SPACE_MONO.SPACE_TRUE_COLORS;
105
- }
106
- if (environment.TERM === "wezterm") {
107
- return SPACE_MONO.SPACE_TRUE_COLORS;
108
- }
109
- if ("TERM_PROGRAM" in environment) {
110
- const version = Number.parseInt((environment.TERM_PROGRAM_VERSION ?? "").split(".")[0], 10);
111
- if (environment.TERM_PROGRAM === "iTerm.app") {
112
- return version >= 3 ? SPACE_MONO.SPACE_TRUE_COLORS : SPACE_MONO.SPACE_256_COLORS;
113
- }
114
- if (environment.TERM_PROGRAM === "Apple_Terminal") {
115
- return SPACE_MONO.SPACE_256_COLORS;
116
- }
117
- }
118
- if (TERM_256_RE.test(environment.TERM)) {
119
- return SPACE_MONO.SPACE_256_COLORS;
120
- }
121
- let isTTY;
122
- if (isDeno) {
123
- isTTY = stdName === "out" ? _this.Deno.stdout.isTerminal() : _this.Deno.stderr.isTerminal();
124
- } else if ("PM2_HOME" in environment && "pm_id" in environment) {
125
- isTTY = true;
126
- } else {
127
- isTTY = proc[`std${stdName}`] && "isTTY" in proc[`std${stdName}`];
128
- }
129
- if (isTTY && TERM_COLOR_RE.test(environment.TERM)) {
130
- return SPACE_MONO.SPACE_16_COLORS;
131
- }
132
- if ("COLORTERM" in environment) {
133
- return SPACE_MONO.SPACE_16_COLORS;
134
- }
135
- return minColorLevel;
136
- };
137
- const isStdoutColorSupported = () => isColorSupportedFactory("out");
138
- const isStderrColorSupported = () => isColorSupportedFactory("err");
139
-
140
- exports.SPACE_16_COLORS = SPACE_MONO.SPACE_16_COLORS;
141
- exports.SPACE_256_COLORS = SPACE_MONO.SPACE_256_COLORS;
142
- exports.SPACE_MONO = SPACE_MONO.SPACE_MONO;
143
- exports.SPACE_TRUE_COLORS = SPACE_MONO.SPACE_TRUE_COLORS;
144
- exports.isStderrColorSupported = isStderrColorSupported;
145
- exports.isStdoutColorSupported = isStdoutColorSupported;
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.cts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.cts";
5
- export type { ColorSupportLevel } from "./types.d.cts";
@@ -1,5 +0,0 @@
1
- import type { ColorSupportLevel } from "./types.d.mts";
2
- export declare const isStdoutColorSupported: () => ColorSupportLevel;
3
- export declare const isStderrColorSupported: () => ColorSupportLevel;
4
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS } from "./color-spaces.d.mts";
5
- export type { ColorSupportLevel } from "./types.d.mts";
@@ -1,136 +0,0 @@
1
- import { SPACE_MONO, SPACE_256_COLORS, SPACE_TRUE_COLORS, SPACE_16_COLORS } from './packem_shared/SPACE_MONO-VdlYcTli.mjs';
2
-
3
- const NO_COLOR_FLAGS_RE = /^-{1,2}(no-color|no-colors|color=false|color=never)$/;
4
- const COLOR_256_FLAGS_RE = /^-{1,2}(color=256)$/;
5
- const COLOR_TRUECOLOR_FLAGS_RE = /^-{1,2}(color=16m|color=full|color=truecolor)$/;
6
- const COLOR_ENABLED_FLAGS_RE = /^-{1,2}(color|colors|color=true|color=always)$/;
7
- const DUMB_TERM_RE = /-mono|dumb/i;
8
- const TEAMCITY_RE = /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/;
9
- const TERM_256_RE = /-256(color)?$/i;
10
- const TERM_COLOR_RE = /^screen|^tmux|^xterm|^vt[1-5]\d\d|^ansi|color|mintty|rxvt|cygwin|linux/i;
11
- const isColorSupportedFactory = (stdName) => {
12
- const _this = globalThis;
13
- const isDeno = _this.Deno != void 0;
14
- const proc = _this.process ?? _this.Deno ?? {};
15
- const argv = proc.argv ?? proc.args ?? [];
16
- const oneOfFlags = (regex) => {
17
- const terminatorPosition = argv.indexOf("--");
18
- const position = argv.findIndex((flag) => regex.test(flag));
19
- return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
20
- };
21
- let environment = {};
22
- try {
23
- environment = isDeno ? proc.env.toObject() : proc.env ?? {};
24
- } catch {
25
- }
26
- const FORCE_COLOR = "FORCE_COLOR";
27
- const hasForceColor = FORCE_COLOR in environment;
28
- const forceColorValue = environment[FORCE_COLOR] ?? void 0;
29
- const forceColorValueIsString = Object.prototype.toString.call(forceColorValue).slice(8, -1) === "String";
30
- const forceColorValueIsNumber = typeof forceColorValue === "number";
31
- let forceColor;
32
- if (forceColorValue === "true") {
33
- forceColor = SPACE_16_COLORS;
34
- } else if (forceColorValue === "false") {
35
- forceColor = SPACE_MONO;
36
- } else if (forceColorValueIsString && forceColorValue.length === 0) {
37
- forceColor = SPACE_16_COLORS;
38
- } else if (forceColorValueIsString && forceColorValue.length > 0) {
39
- forceColor = Math.min(Number.parseInt(forceColorValue, 10), 3);
40
- } else if (forceColorValueIsNumber) {
41
- forceColor = Math.min(forceColorValue, 3);
42
- }
43
- if (forceColorValue !== "true" && forceColorValue !== "false" && forceColor !== void 0 && forceColor < 4) {
44
- return forceColor;
45
- }
46
- const isForceDisabled = "NO_COLOR" in environment || hasForceColor && forceColor === 0 || oneOfFlags(NO_COLOR_FLAGS_RE);
47
- if (isForceDisabled) {
48
- return SPACE_MONO;
49
- }
50
- if (oneOfFlags(COLOR_256_FLAGS_RE)) {
51
- return SPACE_256_COLORS;
52
- }
53
- if (oneOfFlags(COLOR_TRUECOLOR_FLAGS_RE)) {
54
- return SPACE_TRUE_COLORS;
55
- }
56
- const isForceEnabled = oneOfFlags(COLOR_ENABLED_FLAGS_RE);
57
- if (isForceEnabled) {
58
- return SPACE_16_COLORS;
59
- }
60
- const minColorLevel = forceColor ?? SPACE_MONO;
61
- if ("TF_BUILD" in environment && "AGENT_NAME" in environment) {
62
- return SPACE_16_COLORS;
63
- }
64
- const isDumbTerminal = environment.TERM && DUMB_TERM_RE.test(environment.TERM);
65
- if (isDumbTerminal) {
66
- return minColorLevel;
67
- }
68
- if ((isDeno ? _this.Deno.build.os : proc.platform) === "win32") {
69
- try {
70
- const osRelease = (isDeno ? _this.Deno.osRelease() : proc.os.release()).split(".");
71
- if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
72
- return Number(osRelease[2]) >= 14931 ? SPACE_TRUE_COLORS : SPACE_256_COLORS;
73
- }
74
- return SPACE_16_COLORS;
75
- } catch {
76
- }
77
- }
78
- if ("CI" in environment) {
79
- if (["GITEA_ACTIONS", "CIRCLECI", "GITHUB_WORKFLOW", "GITHUB_ACTIONS"].some((sign) => sign in environment)) {
80
- return SPACE_TRUE_COLORS;
81
- }
82
- if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in environment) || environment.CI_NAME === "codeship") {
83
- return SPACE_16_COLORS;
84
- }
85
- return minColorLevel;
86
- }
87
- if (environment.TERMINAL_EMULATOR?.includes("JediTerm")) {
88
- return SPACE_TRUE_COLORS;
89
- }
90
- if ("TEAMCITY_VERSION" in environment) {
91
- return TEAMCITY_RE.test(environment.TEAMCITY_VERSION) ? SPACE_16_COLORS : SPACE_MONO;
92
- }
93
- if (environment.COLORTERM === "truecolor") {
94
- return SPACE_TRUE_COLORS;
95
- }
96
- if (environment.TERM === "xterm-kitty") {
97
- return SPACE_TRUE_COLORS;
98
- }
99
- if (environment.TERM === "xterm-ghostty") {
100
- return SPACE_TRUE_COLORS;
101
- }
102
- if (environment.TERM === "wezterm") {
103
- return SPACE_TRUE_COLORS;
104
- }
105
- if ("TERM_PROGRAM" in environment) {
106
- const version = Number.parseInt((environment.TERM_PROGRAM_VERSION ?? "").split(".")[0], 10);
107
- if (environment.TERM_PROGRAM === "iTerm.app") {
108
- return version >= 3 ? SPACE_TRUE_COLORS : SPACE_256_COLORS;
109
- }
110
- if (environment.TERM_PROGRAM === "Apple_Terminal") {
111
- return SPACE_256_COLORS;
112
- }
113
- }
114
- if (TERM_256_RE.test(environment.TERM)) {
115
- return SPACE_256_COLORS;
116
- }
117
- let isTTY;
118
- if (isDeno) {
119
- isTTY = stdName === "out" ? _this.Deno.stdout.isTerminal() : _this.Deno.stderr.isTerminal();
120
- } else if ("PM2_HOME" in environment && "pm_id" in environment) {
121
- isTTY = true;
122
- } else {
123
- isTTY = proc[`std${stdName}`] && "isTTY" in proc[`std${stdName}`];
124
- }
125
- if (isTTY && TERM_COLOR_RE.test(environment.TERM)) {
126
- return SPACE_16_COLORS;
127
- }
128
- if ("COLORTERM" in environment) {
129
- return SPACE_16_COLORS;
130
- }
131
- return minColorLevel;
132
- };
133
- const isStdoutColorSupported = () => isColorSupportedFactory("out");
134
- const isStderrColorSupported = () => isColorSupportedFactory("err");
135
-
136
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS, isStderrColorSupported, isStdoutColorSupported };
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
4
-
5
- const SPACE_MONO = 0;
6
- const SPACE_16_COLORS = 1;
7
- const SPACE_256_COLORS = 2;
8
- const SPACE_TRUE_COLORS = 3;
9
-
10
- exports.SPACE_16_COLORS = SPACE_16_COLORS;
11
- exports.SPACE_256_COLORS = SPACE_256_COLORS;
12
- exports.SPACE_MONO = SPACE_MONO;
13
- exports.SPACE_TRUE_COLORS = SPACE_TRUE_COLORS;
@@ -1,6 +0,0 @@
1
- const SPACE_MONO = 0;
2
- const SPACE_16_COLORS = 1;
3
- const SPACE_256_COLORS = 2;
4
- const SPACE_TRUE_COLORS = 3;
5
-
6
- export { SPACE_16_COLORS, SPACE_256_COLORS, SPACE_MONO, SPACE_TRUE_COLORS };
package/dist/types.d.cts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Levels:
3
- * - `0` - All colors disabled.
4
- * - `1` - Basic 16 colors support.
5
- * - `2` - ANSI 256 colors support.
6
- * - `3` - Truecolor 16 million colors support.
7
- */
8
- export type ColorSupportLevel = 0 | 1 | 2 | 3;
package/dist/types.d.mts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Levels:
3
- * - `0` - All colors disabled.
4
- * - `1` - Basic 16 colors support.
5
- * - `2` - ANSI 256 colors support.
6
- * - `3` - Truecolor 16 million colors support.
7
- */
8
- export type ColorSupportLevel = 0 | 1 | 2 | 3;
package/dist/types.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /**
2
- * Levels:
3
- * - `0` - All colors disabled.
4
- * - `1` - Basic 16 colors support.
5
- * - `2` - ANSI 256 colors support.
6
- * - `3` - Truecolor 16 million colors support.
7
- */
8
- export type ColorSupportLevel = 0 | 1 | 2 | 3;