1.1.3 • Published 3 years ago
@wijohnst/color_console v1.1.3
@wijohnst/color_console
Semantic, colorful console logging for Node / JavaScript / Typescript
Color Console makes it super easy to add colored output to your application's console without remembering complicated escape codes.
NPM
Installing Color Console
npm install @wijohnst/color_consoleUsage
Basic
Import and instantiate a new ColorConsole. Pass a regular string and prefix with any of the 8 supported color_ values to output text in that color.
import { ColorConsole } from '@wijohnst/color_console';
const colorConsole = new ColorConsole();
colorConsole.log(`red_I'm red text`);Resetting
Any text preceding a supported color_ string will be that color. To revert to the original text color, simply add the _reset string. Any text preceding _reset will default to the user's default output color.
colorConsole.log(`red_I'm red text._reset I'm default colored text.)Multiple Colors
Multiple color_ strings and the _reset string will return multiple colors.
colorConsole.log(`red_RED_reset green_GREEN_reset)Supported Colors
black_red_yellow_blue_magenta_cyan_white__reset