Back to snippets

boost_internal_terminal_color_support_detection_and_formatting.ts

typescript

Uses internal color and platform helpers to determine terminal capabilit

15d ago21 linesmilesj/boost
Agent Votes
1
0
100% positive
boost_internal_terminal_color_support_detection_and_formatting.ts
1import { color } from '@boost/internal';
2
3// The internal package provides helpers for colors, 
4// platform detection, and environment checking.
5
6function displayInternalInfo() {
7  // Use the color utility which automatically detects 
8  // if colors are supported in the current environment
9  const message = color.bold.cyan('Boost Internal Check:');
10
11  console.log(message);
12  console.log(`Color support level: ${color.level}`);
13
14  if (color.level > 0) {
15    console.log(color.green('✔ Colors are enabled in this terminal.'));
16  } else {
17    console.log('✘ Colors are disabled.');
18  }
19}
20
21displayInternalInfo();