# @thesuhu/colorconsole

> Make console log more colorful

Latest version **1.0.5** (published 2021-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @thesuhu/colorconsole
pnpm add @thesuhu/colorconsole
yarn add @thesuhu/colorconsole
bun add @thesuhu/colorconsole
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.5 |
| Published | 2021-09-12 |
| First published | 2021-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | thesuhu |
| Maintainers | thesuhu |
| Keywords | console, log |

## Links

- npm: https://www.npmjs.com/package/@thesuhu/colorconsole
- Repository: https://github.com/thesuhu/colorconsole
- Homepage: https://github.com/thesuhu/colorconsole#readme
- Issues: https://github.com/thesuhu/colorconsole/issues
- npm.io page: https://npm.io/package/@thesuhu/colorconsole

## Dependencies (1)

- [chalk](https://npm.io/package/chalk.md) ^4.1.2

## 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
- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K 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

## Recent versions

- 1.0.5 (latest) — 2021-09-12
- 1.0.4 — 2021-09-12
- 1.0.3 — 2021-09-12
- 1.0.2 — 2021-09-11

## README

# colorconsole

[![npm](https://img.shields.io/npm/v/@thesuhu/colorconsole.svg?style=flat-square)](https://www.npmjs.com/package/@thesuhu/colorconsole)
[![license](https://img.shields.io/github/license/thesuhu/colorconsole?style=flat-square)](https://github.com/thesuhu/colorconsole/blob/master/LICENSE)

Make console log more colorful. While developing, we often deal with console logs. This module provides four templates namely regular log, error log, HTTP log and SQL log.

## Install

```sh
npm install @thesuhu/colorconsole --save-dev
```

## Usage

Below is an example regular and error log.
```js
const { logConsole, errorConsole } = require('@thesuhu/colorconsole')

// regular log
logConsole('Hello world!')

// error log
errorConsole('A very cool error here')
```
Below is an example HTTP log.
```js
const { httpLogConsole } = require('@thesuhu/colorconsole')

// log request for dev
app.use((req, res, next) => {
  if (env == 'dev') httpLogConsole(req)
  next()
})
```
Below is an example SQL log.
```js
const { sqlLogConsole } = require('@thesuhu/colorconsole')

// when work with MySQL
let query = mysql.format(sql, param)
if (env == 'dev') {
    sqlLogConsole(query)
}

// when work with Oracle
let query = queryBindToString(sql, param)
if (env == 'dev') {
    sqlLogConsole(query)
}
```

## License

[MIT](https://github.com/thesuhu/colorconsole/blob/master/LICENSE)

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