chalk breaking changes

npm

21 curated breaking changes across major versions of chalk. Use this as a migration checklist before bumping dependencies.

21
changes
Breaking changes by transition
  • v4.1.2 \u2192 v5.0.0breaking

    It's totally fine to stay on Chalk v4. It's been stable for years.

  • v4.1.2 \u2192 v5.0.0breaking

    If you use TypeScript, you need to use TypeScript 4.7 or later. [Why.](https://github.com/microsoft/TypeScript/issues/46452)

  • v4.1.2 \u2192 v5.0.0breaking

    **This package is now pure ESM. Please [read this](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c).**

  • v4.1.2 \u2192 v5.0.0breaking

    The Chalk issue tracker is not a support channel for your favorite build/bundler tool.

  • v4.1.2 \u2192 v5.0.0breaking

    If you use a bundler, make sure it supports ESM and that you have correctly configured it for ESM.

  • v3.0.0 \u2192 v4.0.0breaking

    Change the `Level` TypeScript type to be a union instead of enum f0f4638 ```diff -if (chalk.level > Level.None) {} +if (chalk.level > 0) {} ```

  • v3.0.0 \u2192 v4.0.0breaking

    Require Node.js 10 61999a4

  • v2.4.2 \u2192 v3.0.0-beta.1breaking

    Require Node.js 8 3ef170b

  • v2.4.2 \u2192 v3.0.0-beta.1breaking

    Remove `chalk.constructor()` in favor of `chalk.Instance()` (#322) de2f4cd

  • v2.4.2 \u2192 v3.0.0-beta.1breaking

    Migrate: ```diff -if (chalk.enabled) {} +if (chalk.level > 0) {} ```

  • v2.4.2 \u2192 v3.0.0-beta.1breaking

    Why: It was confusing to users to have two properties for this.

  • v2.4.2 \u2192 v3.0.0-beta.1breaking

    Remove the `.enabled` property in favor of [`.level`](https://github.com/chalk/chalk#chalklevel) (#356) 1f77953

  • v3.0.0-beta.2 \u2192 v3.0.0breaking

    Migrate: ```diff -if (chalk.enabled) {} +if (chalk.level > 0) {} ```

  • v3.0.0-beta.2 \u2192 v3.0.0breaking

    Require Node.js 8 3ef170b

  • v3.0.0-beta.2 \u2192 v3.0.0breaking

    Remove the `.enabled` property in favor of [`.level`](https://github.com/chalk/chalk#chalklevel) (#356) 1f77953

  • v3.0.0-beta.2 \u2192 v3.0.0breaking

    Why: It was confusing to users to have two properties for detecting color support.

  • v3.0.0-beta.2 \u2192 v3.0.0breaking

    Remove `chalk.constructor()` in favor of `chalk.Instance()` (#322) de2f4cd

  • v1.1.1 \u2192 v2.0.0breaking

    Requires Node.js 4 or later.

  • v1.1.1 \u2192 v2.0.0breaking

    Removed `chalk.hasColor()`. Use the [`has-ansi`](https://github.com/chalk/has-ansi) package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b

  • v1.1.1 \u2192 v2.0.0breaking

    Removed `chalk.stripColor()`. Use the [`strip-ansi`](https://github.com/chalk/strip-ansi) package directly instead. https://github.com/chalk/chalk/commit/04cae226cc0fc11fd7898f3fa91fdc4a3b3e496b

  • v1.1.1 \u2192 v2.0.0breaking

    Removed `chalk.styles`. Use the [`ansi-styles`](https://github.com/chalk/ansi-styles) package directly instead. https://github.com/chalk/chalk/commit/870249689acc6b04e81e96d2c09c39b76c640a94

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/npm/chalk