Hello 馃憢
The package cliui remove "some" colors when working with ESM. Everything is fine with CJS. I found the problem on a CLI project I just migrated and I couldn't understand why my colors were not working anymore.
I'm working on Windows 10 and Node.js v16
How to reproduce:
$ mkdir cliui_bug
$ cd cliui_bug
$ npm init -y
$ npm i kleur cliui -P
# Add type: module in package.json
The index.js file
import kleur from "kleur";
import cliui from "cliui";
// const kleur = require("kleur");
// const cliui = require("cliui");
const { white, cyan, red } = kleur;
const ui = cliui();
const title = `${white().bold("name:")} ${cyan().bold("express")}`;
console.log(title);
ui.div(
{ text: title, width: 50 }
);
ui.div({ text: red("-------------------------------------------------------------------"), width: 70 });
console.log(ui.toString());
Output with ESM:

The title with cliui doesn't work. If you switch the project to CJS it will work as expected.
Best Regards,
Thomas
Hello 馃憢
The package
cliuiremove "some" colors when working with ESM. Everything is fine with CJS. I found the problem on a CLI project I just migrated and I couldn't understand why my colors were not working anymore.How to reproduce:
The index.js file
Output with ESM:

The title with cliui doesn't work. If you switch the project to CJS it will work as expected.
Best Regards,
Thomas