# color-my-log

> Lightweight and easy-to-use npm package for adding colorful terminal messages in Node.js effortlessly.

Latest version **2.0.0** (published 2023-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install color-my-log
pnpm add color-my-log
yarn add color-my-log
bun add color-my-log
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2023-07-31 |
| First published | 2023-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mark Tyree |
| Maintainers | hard-luck |
| Keywords | node, color, console, log, Node.js terminal colors, colorful console logs, Node.js logging, simple logging utility |

## Links

- npm: https://www.npmjs.com/package/color-my-log
- Repository: https://github.com/Hard-Luck/color-my-log
- Homepage: https://github.com/Hard-Luck/color-my-log#readme
- Issues: https://github.com/Hard-Luck/color-my-log/issues
- npm.io page: https://npm.io/package/color-my-log

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 2.0.0 (latest) — 2023-07-31
- 1.1.1 — 2023-07-31
- 1.1.0 — 2023-07-31
- 1.0.9 — 2023-07-30
- 1.0.8 — 2023-07-30
- 1.0.7 — 2023-07-30
- 1.0.6 — 2023-07-30
- 1.0.5 — 2023-07-30

## README

# color-my-log (WIP)

**LOWERCASE BACKGROUND COLOURS && TYPES ADDED**
**NOTE: This package is currently a work in progress (WIP). It provides a simple way to print colored log messages with background colors in Node.js applications. Additional features and options may be added in future releases.**

`color-my-log` is a lightweight npm package that enables you to print colored log messages in Node.js applications. It currently supports customizing the background color of log messages.

## Installation

You can install `color-my-log` using npm:

```bash
npm install color-my-log
```

## Usage

To use `color-my-log` in your Node.js application, first, require the package and create an instance of the `Log` class:

### JS

```javascript
const { log } = require("color-my-log");
```

### ES6

```typescript
import { log } from "color-my-log";
```

_Coming soon_

### Printing Colored Log Messages

The `color-my-log` package provides methods to print log messages with different foreground colors and customizable background colors. You can use the following methods to print log messages with different foreground colors and a specified background color:

```javascript
log.red(message, options);
log.black(message, options);
log.green(message, options);
log.yellow(message, options);
log.blue(message, options);
log.magenta(message, options);
log.cyan(message, options);
log.white(message, options);
```

![image](https://github.com/Hard-Luck/color-my-log/assets/72257311/66bd1a7a-10b6-4b06-b485-be5eb02e0619)

**Parameters:**

- `message` (string): The log message that you want to print.
- `options` (optional object): An optional object to customize the log appearance.
  - `background` (string): Specify the background color for the log message. Valid values are `'black'`, `'red'`, `'green'`, `'yellow'`, `'blue'`, `'magenta'`, `'cyan'`, and `'white'`.

**Example:**

```javascript
log.red("Error occurred!", { background: "yellow" });
log.blue("Info message", { background: "green" });
```

### Available Colors

The following are the available foreground colors that you can use with the `color-my-log` package:

- `red`
- `black`
- `green`
- `yellow`
- `blue`
- `magenta`
- `cyan`
- `white`

### Customization

The package is currently under development, and more features and customization options may be added in future releases. The package uses ANSI escape codes for color formatting, and you can easily extend it with your own color choices.

If you have any suggestions or feature requests, feel free to submit them to [GitHub repository link].

## License

This package is open-source and distributed under the MIT License. Feel free to use, modify, and distribute it as per the terms of the license.

## Author

`color-my-log` was created by Mark Tyree. You can reach me at [tyreemarka@gmail.com](mailto:tyreemarka@gmail.com).

---
_Source: https://npm.io/package/color-my-log · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
