thenavisapp
Version:
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
28 lines (23 loc) • 603 B
JavaScript
import process from 'node:process';
import styles from 'ansi-styles';
import chalk from '../source/index.js';
// Generates screenshot
for (const key of Object.keys(styles)) {
let returnValue = key;
// We skip `overline` as almost no terminal supports it so we cannot show it off.
if (
key === 'reset'
|| key === 'hidden'
|| key === 'grey'
|| key === 'bgGray'
|| key === 'bgGrey'
|| key === 'overline'
|| key.endsWith('Bright')
) {
continue;
}
if (/^bg[^B]/.test(key)) {
returnValue = chalk.black(returnValue);
}
process.stdout.write(chalk[key](returnValue) + ' ');
}