# console-color-mr

> this plugins is used for color of console message

Latest version **2.0.2** (published 2021-03-24) · ISC license · 0 weekly downloads

## Install

```sh
npm install console-color-mr
pnpm add console-color-mr
yarn add console-color-mr
bun add console-color-mr
```

## 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 | 2.0.2 |
| Published | 2021-03-24 |
| First published | 2018-01-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Michael Ray |
| Maintainers | michaelray |
| Keywords | consle, color |

## Links

- npm: https://www.npmjs.com/package/console-color-mr
- npm.io page: https://npm.io/package/console-color-mr

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 2.0.2 (latest) — 2021-03-24
- 2.0.1 — 2019-02-19
- 2.0.0 — 2018-01-12
- 1.1.0 — 2018-01-11
- 1.0.3 — 2018-01-11
- 1.0.2 — 2018-01-11
- 1.0.1 — 2018-01-11
- 1.0.0 — 2018-01-11

## README

# Description
这是一个在控制台文字变色的插件，主要方便调试。
This plugins is used for color of console message.
It is mainly convenient for debugging.
# install
> npm install console-color-mr -D

# use
``
require('console-color-mr');
``
# DEMO1
设定了默认颜色。console.info直接输出为红色
If you use default color, the default color is red.
````
//use color
console.info('------------ default color--------');
console.info('info', 'this is green text'); //green text
console.warn('this is warn');//yellowBG text
console.error('this is error');//red text
console.debug('this is debug');//gray text
console.log('this is log','msg1'.red, 'msg2'.blue);
console.info('this is info','msg1'.red, 'msg2'.blue); //force change default color
console.info('----------------------------');
````
# DEMO2

你可以在变量或者函数中使用变色
You can use color in variable or function

````
console.group('---------variable use color------------');

let name = 'Michael';
let age    = 1000;

let obj  = {
	name : 'michael',
	age  : '100'
};

function hello(){
	return 'hello';
}

function isBoole(){
	return true;
}

console.log(name);
console.log('Hello,My name is ' + name.green +',I am a'+' man'.yellow+'.');
console.log(age.blue);
console.log(obj.name.blue);
console.log(hello().red);
//Boolean value must change to string.
console.log(isBoole().toString().red);

console.groupEnd();
````

## DEMO3

use default console function

````
let _console = require('console-color-mr');

console.info('-------------use default console function---------------');
_console.info('info');
_console.debug('debug');
_console.warn('warn');
_console.error('error');
_console.info('info','ff','cc');
console.info('----------------------------');
````

## style
- 'bold'          
- 'italic'        
- 'underline'     
- 'inverse'       
- 'strikethrough' 
- 'white'         
- 'grey'          
- 'black'         
- 'blue'          
- 'cyan'         
- 'green'        
- 'magenta'       
- 'red'           
- 'yellow'        
- 'whiteBG'       
- 'greyBG'
- 'blackBG'      
- 'blueBG'        
- 'cyanBG'        
- 'greenBG'       
- 'magentaBG'     
- 'redBG'        
- 'yellowBG'

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