# kolorist

> A tiny utility to colorize stdin/stdout

Latest version **1.8.0** (published 2023-04-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install kolorist
pnpm add kolorist
yarn add kolorist
bun add kolorist
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2023-04-22 |
| First published | 2020-02-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 49.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 322 |
| Author | Marvin Hagemeister |
| Maintainers | marvinhagemeister |

## Links

- npm: https://www.npmjs.com/package/kolorist
- Repository: https://github.com/marvinhagemeister/kolorist
- Homepage: https://github.com/marvinhagemeister/kolorist#readme
- Issues: https://github.com/marvinhagemeister/kolorist/issues
- npm.io page: https://npm.io/package/kolorist

## Recent versions

- 1.8.0 (latest) — 2023-04-22
- 1.7.0 — 2023-02-03
- 1.6.0 — 2022-09-11
- 1.5.1 — 2021-12-17
- 1.5.0 — 2021-06-18
- 1.4.1 — 2021-04-24
- 1.4.0 — 2021-03-31
- 1.3.2 — 2021-03-17
- 1.3.1 — 2021-03-17
- 1.3.0 — 2021-03-17
- 1.2.10 — 2021-01-12
- 1.2.9 — 2021-01-02
- 1.2.8 — 2020-12-31
- 1.2.7 — 2020-10-13
- 1.2.6 — 2020-10-07
- … 8 more at https://npm.io/package/kolorist/versions

## README

# kolorist

Tiny library to put colors into stdin/stdout :tada:

![Screenshot of terminal colors](.github/demo.png)

## Usage

```bash
npm install --save-dev kolorist
```

```js
import { red, cyan } from 'kolorist';

console.log(red(`Error: something failed in ${cyan('my-file.js')}.`));
```

You can also disable or enable colors globally via the following environment variables:

- disable:
  - `NODE_DISABLE_COLORS`
  - `NO_COLOR`
  - `TERM=dumb`
  - `FORCE_COLOR=0`

- enable:
  - `FORCE_COLOR=1`
  - `FORCE_COLOR=2`
  - `FORCE_COLOR=3`

On top of that you can disable colors right from node:

```js
import { options, red } from 'kolorist';

options.enabled = false;
console.log(red('foo'));
// Logs a string without colors
```

You can also strip colors from a string:

```js
import { red, stripColors } from 'kolorist';

console.log(stripColors(red('foo')));
// Logs 'foo'
```

### License

`MIT`, see [the license file](./LICENSE).

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