open-index/open-npm huggingface dataset:
npm package: @mateoox600/m-color
Description: Color lib
Latest version: 0.0.5

# **MColor**

Npm package for console coloring.

---
## Features
 - Full html color list
 - Custom colors via Color class
 - Text Styling (Bold, Italic, etc)
---
## Installation
```console
npm install @mateoox600/m-color
```
 - Typescript is supported and types comes with the installation
---
## Usage
```js
const { mColor, HtmlColors, TextStyle, Color } = require('m-color');

console.log(mColor([ HtmlColors.Red.asFore(), TextStyle.Italic ], 'This text is red and in italic'));
console.log(mColor(new Color(0, 255, 0).asFore(), 'Text in blue'));
```
---
## Docs
### HtmlColors
 - [colors list](https://www.w3.org/wiki/CSS/Properties/color/keywords)

### TextStyles
 - **Bold**
 - Dim
 - *Italic*
 - <u>Underline</u>
 - For all text styles an inverse exist prefixed by `No` it can be used to remove style in a section of styled text without separating the text in two

### Color
  A class to create colors, takes three args: red, green, blue.
  This class can be used to create foreground or background colors.
  The asBack() method returns the color for background.
  The asFore() method returns it for foreground.
npm package: @mateoox600/m-console
Description: Console utils lib
Latest version: 0.0.6

# **MConsole**

Npm package for console utilities.

---
## Features
 - Utility functions
 - Progress bar
---
## Installation
```console
npm install @mateoox600/m-console
```
 - Typescript is supported and types comes with the installation
---
## Usage
```js
const { ProgressBar } = require('@mateoox600/m-console');

const progressBar = new ProgressBar(120, 10, '[{progressBar}] {progress}/{max}');

progressBar.start();

const interval = setInterval(() => {
    progressBar.update(progressBar.getProgress() + 1);

    if(progressBar.finished) {
        progressBar.stop();
        clearInterval(interval);
        console.log('finished');
    }
}, 10);
```
---
## Docs
### `clear()`
 - clear the console
### ProgressBar
 - Takes three args:
    - `max` the max value of the progressBar
    - `progress` the default start progress
    - `format` the format of the bar in the console
 - You need to `.start()` the bar before being able to use it
 - The bar automaticly stops when reaching the bar max
 - An automatic redraw is done when you update the bar
 - `getProgress()` and `getMax()` can be used to get the progress and max value of the bar
 - The `finished` value return if the bar progress is >= to the bar max
npm package: @mateoox600/m-logger
Description: Logger lib
Latest version: 0.0.5

# **MLogger**

Npm package for logging, works in pair with [m-color](https://github.com/mateoox600/MColor).

---
## Features
 - Logging work in pair with [m-color](https://github.com/mateoox600/MColor)
 - Event emitter for logs levels
 - Prefix and suffix for log levels
---
## Installation
```console
npm install @mateoox600/m-logger
```
 - Typescript is supported and types comes with the installation
---
## Usage
```js
const { HtmlColors } = require('@mateoox600/m-color');
const { Logger } = require('@mateoox600/m-logger');

const logger = new Logger({
    info: { },
    warn: { colors: HtmlColors.Yellow.asFore(), prefix: '[WARN] ' },
    error: { colors: HtmlColors.Red.asBack(), prefix: '[ERROR] ', suffix: ' !!!' }
}, 'info');

logger.on('warn', (str) => {
    console.log(`This logs before warns and the warn is: '${str}'`);
});

logger.log('This is an info with 0 coloring');
logger.log('This is a yellow warn', 'warn');
logger.log('This failed', 'error');
```
---
## Docs
### Logger
 - Takes as arguments an object describing all the log levels, and an optional string for the default log level
 - on(logLevel, listener) : The listener takes a string and is called when something of that log level is logged
 - log(string, logLevel) : Logs the string at the given log level or the default log level if none of the two exist it throw a "Parameter missing"