@juparog/print-table
Version:
print-table is a simple library that allows you to print beautiful and customizable tables in the console using ANSI escape codes. It is ideal for displaying tabular data in a clear and visually appealing way.
100 lines • 4.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AlignmentText = exports.BrightBgColor = exports.BgColor = exports.BrightForegroundColor = exports.ForegroundColor = exports.STRIKE_THROUGH_MODE = exports.HIDDEN_MODE = exports.INVERSE_MODE = exports.RAPID_BLINK_MODE = exports.SLOW_BLINK_MODE = exports.UNDERLINE_MODE = exports.ITALICIZE_MODE = exports.FAINT_MODE = exports.BOLD_MODE = exports.RESET_ALL_MODES = exports.END_CODE = exports.CSI_CODE = exports.ESC_CODE = void 0;
/**
* Escape code used for control sequences.
*/
exports.ESC_CODE = '\x1B'; // Escape sequence control (ESC)
exports.CSI_CODE = '\x5B'; // Control sequence introducer ([)
exports.END_CODE = '\x6D'; // Ansi scape sequence ending (m)
/**
* Colors / Graphics mode
*/
exports.RESET_ALL_MODES = '\x30'; // Reset all modes (styles and colors) (0)
exports.BOLD_MODE = '\x31'; // Bold or increased intensity (1)
exports.FAINT_MODE = '\x32'; // Faint (decreased intensity) (2)
exports.ITALICIZE_MODE = '\x33'; // Italicize (3)
exports.UNDERLINE_MODE = '\x34'; // Underline (4)
exports.SLOW_BLINK_MODE = '\x35'; // Slow blink (5)
exports.RAPID_BLINK_MODE = '\x36'; // Rapid blink (6)
exports.INVERSE_MODE = '\x37'; // Inverse or reverse; swap foreground and background (7)
exports.HIDDEN_MODE = '\x38'; // Hidden (8)
exports.STRIKE_THROUGH_MODE = '\x39'; // Strike-through (9)
/**
* Foreground colors
*/
var ForegroundColor;
(function (ForegroundColor) {
ForegroundColor["BLACK"] = "30";
ForegroundColor["RED"] = "31";
ForegroundColor["GREEN"] = "32";
ForegroundColor["YELLOW"] = "33";
ForegroundColor["BLUE"] = "34";
ForegroundColor["MAGENTA"] = "35";
ForegroundColor["CYAN"] = "36";
ForegroundColor["WHITE"] = "37";
})(ForegroundColor || (exports.ForegroundColor = ForegroundColor = {}));
/**
* Bright foreground colors
*/
var BrightForegroundColor;
(function (BrightForegroundColor) {
BrightForegroundColor["BRIGHT_BLACK"] = "90";
BrightForegroundColor["BRIGHT_RED"] = "91";
BrightForegroundColor["BRIGHT_GREEN"] = "92";
BrightForegroundColor["BRIGHT_YELLOW"] = "93";
BrightForegroundColor["BRIGHT_BLUE"] = "94";
BrightForegroundColor["BRIGHT_MAGENTA"] = "95";
BrightForegroundColor["BRIGHT_CYAN"] = "96";
BrightForegroundColor["BRIGHT_WHITE"] = "97";
})(BrightForegroundColor || (exports.BrightForegroundColor = BrightForegroundColor = {}));
/**
* Background colors
*/
var BgColor;
(function (BgColor) {
BgColor["BLACK"] = "40";
BgColor["RED"] = "41";
BgColor["GREEN"] = "42";
BgColor["YELLOW"] = "43";
BgColor["BLUE"] = "44";
BgColor["MAGENTA"] = "45";
BgColor["CYAN"] = "46";
BgColor["WHITE"] = "47";
})(BgColor || (exports.BgColor = BgColor = {}));
/**
* Bright background colors
*/
var BrightBgColor;
(function (BrightBgColor) {
BrightBgColor["BRIGHT_BLACK"] = "90";
BrightBgColor["BRIGHT_RED"] = "91";
BrightBgColor["BRIGHT_GREEN"] = "92";
BrightBgColor["BRIGHT_YELLOW"] = "93";
BrightBgColor["BRIGHT_BLUE"] = "94";
BrightBgColor["BRIGHT_MAGENTA"] = "95";
BrightBgColor["BRIGHT_CYAN"] = "96";
BrightBgColor["BRIGHT_WHITE"] = "97";
})(BrightBgColor || (exports.BrightBgColor = BrightBgColor = {}));
/**
* Alignment of the text in a table cell.
*/
var AlignmentText;
(function (AlignmentText) {
AlignmentText["LEFT"] = "left";
AlignmentText["CENTER"] = "center";
AlignmentText["RIGHT"] = "right";
AlignmentText["TOP"] = "top";
AlignmentText["MIDDLE"] = "middle";
AlignmentText["BOTTOM"] = "bottom";
AlignmentText["LEFT_TOP"] = "left-top";
AlignmentText["LEFT_MIDDLE"] = "left-middle";
AlignmentText["LEFT_BOTTOM"] = "left-bottom";
AlignmentText["CENTER_TOP"] = "center-top";
AlignmentText["CENTER_MIDDLE"] = "center-middle";
AlignmentText["CENTER_BOTTOM"] = "center-bottom";
AlignmentText["RIGHT_TOP"] = "right-top";
AlignmentText["RIGHT_MIDDLE"] = "right-middle";
AlignmentText["RIGHT_BOTTOM"] = "right-bottom";
})(AlignmentText || (exports.AlignmentText = AlignmentText = {}));
//# sourceMappingURL=constants.js.map