đź–Ť Terminal string styling done right
This release has been in development for more than a year and massively improves performance and the time it takes to import Chalk.
Thanks to @stroncium for his hard work on this. 🙌
.enabled
property in favor of .level
(#356) 1f77953
-if (chalk.enabled) {}
+if (chalk.level > 0) {}
chalk.constructor()
in favor of chalk.Instance()
(#322) de2f4cd
-new chalk.constructor({level: 1});
+new chalk.Instance({level: 1})
-import chalk from 'chalk';
+import chalk = require('chalk');
flow-typed
).ChalkOptions
TypeScript type to Options
cf66156dim
style workaround for Windows (#331) cd5de7a
blue
color workaround for Windows (#330) 2ca015c
chalk.stderr
for printing to stderr (#359) 2a53389blackBright
color. It's the same as the gray
color, but added for consistency. c25c32aansi256
and bgAnsi256
to TypeScript declaration (#368) fb8e85aansi
and bgAnsi
to TypeScript declaration (#369) 18c280dFORCE_COLOR
environment variable can now be used to force a certain color level (#315) af4a078TERM=dumb
higher priority in the color detection https://github.com/chalk/supports-color/commit/8d6a7b5830a96858a95ce9cfee1840dc30a3e837
supportsColor
which is top‑level only (#342) b3e9b91chalk.supportsColor
(#347) d82b2a6unknown
instead of just string
(#316) 7f6e563While this is a beta release, the code is well-tested and fairly stable.
We encourage you to test it out and report any issues.
$ npm install [email protected]
See the beta 1 release notes for more.
ansi256
and bgAnsi256
to TypeScript declarations (#368) fb8e85ahttps://github.com/chalk/chalk/compare/v3.0.0-beta.1...v3.0.0-beta.2
This release has been in development for more than a year and massively improves performance and the time it takes to import Chalk. Thanks to @stroncium for his hard work on this.
While this is a beta release, the code is well-tested and fairly stable.
We encourage you to test it out and report any issues.
$ npm install [email protected]
.enabled
property in favor of .level
(#356) 1f77953
-if (chalk.enabled) {}
+if (chalk.level > 0) {}
chalk.constructor()
in favor of chalk.Instance()
(#322) de2f4cd
-new chalk.constructor({level: 1});
+new chalk.Instance({level: 1})
-import chalk from 'chalk';
+import chalk = require('chalk');
ChalkOptions
TypeScript type to Options
cf66156dim
style workaround for Windows (#331) cd5de7a
blue
color workaround for Windows (#330) 2ca015c
chalk.stderr
for printing to stderr (#359) 2a53389blackBright
color. It's the same as the gray
color, but added for consistency. c25c32aFORCE_COLOR
environment variable can now be used to force a certain color level (#315) af4a078TERM=dumb
higher priority in the color detection https://github.com/chalk/supports-color/commit/8d6a7b5830a96858a95ce9cfee1840dc30a3e837
supportsColor
which is top‑level only (#342) b3e9b91chalk.supportsColor
(#347) d82b2a6unknown
instead of just string
(#316) 7f6e563https://github.com/chalk/chalk/compare/v2.4.1...v3.0.0-beta.1
This release is done from the v2-release
branch, as master
branch targets the work-in-progress v3 release.
chalk.ansi256
when in a terminal with 256-color level support. https://github.com/chalk/ansi-styles/commit/1ac7472f8bb4f583299b6d5ef87a383f7b564b4b
level
when forcing color. https://github.com/chalk/supports-color/commit/b16e9a4b9f13b3930e184e2f582b55091216fe47
.visible()
method for emitting text only when Chalk is enabled. This can be useful for purely cosmetic content that shouldn't be shown when there are no colors, like when piping the output. https://github.com/chalk/chalk/commit/dc092b4a5f5ca77dd1e22607cdf2fdd388803064