react-easeauth
Version:
This repository contains an npm package for colorized console printing, providing easy-to-use methods for printing messages in various colors to enhance readability.
68 lines (67 loc) • 2.28 kB
JavaScript
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.chroma = void 0;
const chalk_1 = __importDefault(require("chalk"));
class Chroma {
info(message, end = "\n") {
/**
* Prints an informational message in blue color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.blue(message) + end);
}
;
warn(message, end = "\n") {
/**
* Prints a warning message in yellow color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.yellow(message) + end);
}
;
error(message, end = "\n") {
/**
* Prints an error message in red color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.red(message) + end);
}
;
success(message, end = "\n") {
/**
* Prints a success message in green color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.green(message) + end);
}
;
secondary(message, end = "\n") {
/**
* Prints a secondary message in gray color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.gray(message) + end);
}
;
boldWhite(message, end = "\n") {
/**
* Prints a message in bold white color.
* @param message - The message to print.
* @param end - The string to append at the end of the message.
*/
process.stdout.write(chalk_1.default.bold.hex("#ffffff")(message) + end);
}
;
}
exports.default = Chroma;
;
// Creating a global instance for convenience
exports.chroma = new Chroma();
;