--- name: chalk description: Use chalk@^6.0.0 correctly from Node.js 22+ ESM, including deterministic color levels, v6 underline styles/colors, Chalk instances, and exported capability metadata. --- Verified against chalk@6.0.0 on 2026-09-08. 6 of 6 examples executed. # chalk@^6.0.0 ## Runtime and package shape - Chalk 6 is ESM-only and requires Node.js 22 or newer. - Import the default export or named exports from `chalk`. Do not use `require()` or assume a CommonJS entry point. - Chalk formats strings; it is not a command-line runner. Direct scripts can use its formatting API, while command-line usage belongs to the separate `chalk-cli` package. ```ts pmcp-example import assert from 'node:assert/strict'; import chalk, {Chalk} from 'chalk'; assert.equal(typeof chalk, 'function'); assert.equal(typeof Chalk, 'function'); const plain = new Chalk({level: 0}); assert.equal(plain.blue('hello'), 'hello'); assert.equal(plain.bold.red('error'), 'error'); ``` ## Chaining styles and arguments A style chain is callable: `chalk.