Sha256: fd43aad67d9f1475db69ca2e9a82677e6ee443d177e703fff75b8c4ce4be61f8
Contents?: true
Size: 763 Bytes
Versions: 21
Compression:
Stored size: 763 Bytes
Contents
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.colorString = void 0; const COLOR_MAP = { red: '\x1b[31m', green: '\x1b[32m', yellow: '\x1b[33m', blue: '\x1b[34m', magenta: '\x1b[35m', cyan: '\x1b[36m', white: '\x1b[37m', crimson: '\x1b[38m', white_bold: '\x1b[01m', reset: '\x1b[0m', }; const colorString = (color, text) => `${color && COLOR_MAP[color]}${text}${COLOR_MAP.reset}`; exports.colorString = colorString; class ColoredConsoleLine { constructor() { this.text = ''; } addCharsWithColor(color, text) { this.text += exports.colorString(color, text); } renderConsole() { return this.text; } } exports.default = ColoredConsoleLine;
Version data entries
21 entries across 21 versions & 1 rubygems