All Projects → bvaughn → console.pretty

bvaughn / console.pretty

Licence: MIT License
Pretty console logging

Programming Languages

javascript
184084 projects - #8 most used programming language

console.pretty

artist palette

Pretty console logging.


version MIT License styled with prettier

The problem

You're trying to log information, but have a hard time tracking down what the output means, where it came from, or can't find what you're looking for quickly.

This solution

Use colors to easily parse through your console.

Example

import log, { green } from "console.pretty";

const handleOnClick = () => {
  log.blue("Click!");
};

const handleMouseover = () => {
  green("Mouseover!");
};

Installation

This module is distributed via npm which is bundled with node and should be installed as one of your project's dependencies:

$ npm install console.pretty

or

$ yarn add console.pretty

API

By default, the following colors are available:

  • blue
  • brown
  • gray
  • green
  • red
  • orange
  • purple
  • yellow

However, you can also build your own logger using the provided createLogger.

import { createLogger } from "console.pretty";

const pink = createLogger("#FFC0CB", "#000000");

pink("My pink logger");

LICENSE

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].