# @comodinx/colors

> @comodinx/colors is a Node.js string colors helpers.

Latest version **1.0.4** (published 2022-05-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @comodinx/colors
pnpm add @comodinx/colors
yarn add @comodinx/colors
bun add @comodinx/colors
```

## 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.4 |
| Published | 2022-05-16 |
| First published | 2022-05-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Milo Molina Developer |
| Maintainers | comodinx |
| Keywords | ansi, terminal, colors |

## Links

- npm: https://www.npmjs.com/package/@comodinx/colors
- Repository: https://gitlab.com/comodinx/colors
- Homepage: https://gitlab.com/comodinx/colors#readme
- Issues: https://gitlab.com/comodinx/colors/issues
- npm.io page: https://npm.io/package/@comodinx/colors

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 1.0.4 (latest) — 2022-05-16
- 1.0.3 — 2022-05-16
- 1.0.2 — 2022-05-16
- 1.0.1 — 2022-05-16
- 1.0.0 — 2022-05-16

## README

# @comodinx/colors

This is a simple proof of concept. An exercise.

We were inspired by and strongly recommend using [colors](https://www.npmjs.com/package/colors)

## Installation

```sh
npm i @comodinx/colors
```

## colors and styles!

### text and bright text colors

| color     | bright          | 
|:----------|:----------------|
| black     |                 |
| red       | brightRed       |
| green     | brightGreen     |
| yellow    | brightYellow    |
| blue      | brightBlue      |
| magenta   | brightMagenta   |
| cyan      | brightCyan      |
| white     | brightWhite     |
| grey      |                 |

### background and bright background colors

| color     | bright          | 
|:----------|:----------------|
| bgBlack   |                 |
| bgRed     | bgBrightRed     |
| bgGreen   | bgBrightGreen   |
| bgYellow  | bgBrightYellow  |
| bgBlue    | bgBrightBlue    |
| bgMagenta | bgBrightMagenta |
| bgCyan    | bgBrightCyan    |
| bgWhite   | bgBrightWhite   |
| bgGrey    |                 |

### styles

| style         |
|:--------------|
| reset         |
| bold          |
| dim           |
| italic        |
| underline     |
| inverse       |
| hidden        |
| strikethrough |

## Usage

The super nifty way

```js
require('@comodinx/colors');

console.log('hello'.green);
console.log('i like cake and pies'.underline.red);
console.log('inverse the color'.inverse);
```

or a slightly less nifty way which doesn't extend String.prototype

```js
const colors = require('@comodinx/colors/safe');

console.log(colors.green('hello'));
console.log(colors.red(colors.underline('i like cake and pies')));
console.log(colors.inverse('inverse the color'));
```

## Prevent extend `String.prototype`

```sh
COLORS_ON_STRING_PROTO=0 node myapp.js
```

## Console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)

```js
const name = 'Marak';
console.log(colors.green('Hello %s'), name);
// outputs -> 'Hello Marak'
```

## Alias

```js
const colors = require('@comodinx/colors');

colors.setAlias({
    title: 'bold',
    success: 'green',
    error: 'red',
    warn: 'yellow',
    info: 'cyan'
});

console.log('🟢  Congratulations'.success);
console.log('🔴  ERROR'.error);
console.log('🟡  ¡¡¡WARNING!!!'.warn);
console.log('🔵  This is an information message'.info);
console.log('This is a title for success message'.title.success);
```

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