chalk/examples/screenshot.js
Richie Bendall 83341478e9
Add overline style and remove keyword, hsl, hsv, hwb and ansi style
Signed-off-by: Richie Bendall <richiebendall@gmail.com>
2021-04-18 02:22:16 +12:00

17 lines
373 B
JavaScript

import styles from 'ansi-styles';
import chalk from '../source/index.js';
// Generates screenshot
for (const key of Object.keys(styles)) {
let returnValue = key;
if (key === 'reset' || key === 'hidden' || key === 'grey') {
continue;
}
if (/^bg[^B]/.test(key)) {
returnValue = chalk.black(returnValue);
}
process.stdout.write(chalk[key](returnValue) + ' ');
}