Skip to content

A console wrapper to easily output coloured messages.

Notifications You must be signed in to change notification settings

DanielWinning/console-logger

Repository files navigation

Console Logger

Version 0.2.2 Coverage 100.00%

A console wrapper to easily output coloured messages.

Installation

npm install @dannyxcii/console-logger

Usage

import { ConsoleColour, ConsoleLogger } from '@dannyxcii/console-logger';

// console.log()'s a blue message
ConsoleLogger.logInfo(<string>message);

// console.log()'s a green message
ConsoleLogger.logSuccess(<string>message);

// console.warn()'s a yellow message
ConsoleLogger.logWarning(<string>message);

// console.error()'s a red message
ConsoleLogger.logError(<string>message);

// Any colour/style combination you like from the ConsoleColour enum
ConsoleLogger.log(<string>message, <Array<string>>colours);

// Example .log() usage
ConsoleLogger.log('My message', [
    ConsoleColour.FgCyan, 
    ConsoleColour.BgMagenta, 
    ConsoleColour.Blink
]);