Skip to content

Instantly share code, notes, and snippets.

View rickmed's full-sized avatar

Ricardo Medina rickmed

View GitHub Profile
@rickmed
rickmed / colors.js
Created March 14, 2023 22:35
javascript ansi colors with Proxy in Object.Prototype
// https://man7.org/linux/man-pages/man4/console_codes.4.html
const supportedStyleCodes = new Map([
["black", [30, 39]],
["red", [31, 39]],
["green", [32, 39]],
["yellow", [33, 39]],
["blue", [34, 39]],
["magenta", [35, 39]],
["cyan", [36, 39]],
["white", [37, 39]],