UNPKG

@dreamhorizonorg/sentinel

Version:

Open-source, zero-dependency tool that blocks compromised packages BEFORE download. Built to counter supply chain and credential theft attacks like Shai-Hulud.

51 lines (41 loc) 1.04 kB
/** * Color output utilities * Pure functions for terminal color formatting using ANSI escape codes */ import { ANSI_CODES } from '../constants/color.constants.mjs'; /** * Apply red color to text */ export const red = (text) => `${ANSI_CODES.RED}${text}${ANSI_CODES.RESET}`; /** * Apply green color to text */ export const green = (text) => `${ANSI_CODES.GREEN}${text}${ANSI_CODES.RESET}`; /** * Apply yellow color to text */ export const yellow = (text) => `${ANSI_CODES.YELLOW}${text}${ANSI_CODES.RESET}`; /** * Apply blue color to text */ export const blue = (text) => `${ANSI_CODES.BLUE}${text}${ANSI_CODES.RESET}`; /** * Apply bold formatting to text */ export const bold = (text) => `${ANSI_CODES.BOLD}${text}${ANSI_CODES.RESET}`; /** * Apply dim formatting to text */ export const dim = (text) => `${ANSI_CODES.DIM}${text}${ANSI_CODES.RESET}`; /** * Color utilities object (for backward compatibility) */ export const colors = { red, green, yellow, blue, bold, dim, reset: ANSI_CODES.RESET };