chalk
, cli-color
, and similar libraries have various alternatives which are lighter and faster.
A widely used alternative which is much lighter and faster.
A lighter alternative which also supports 256 color creation.
Node itself has a styleText
function in the built-in util
library.
You can use it like so:
import { styleText } from 'node:util';
styleText('green', 'Success!')