# ansikit

> 🎨 The ultimate terminal ANSI kit.

Latest version **1.5.0** (published 2020-10-16) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2020-10-16 |
| First published | 2020-09-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luvella |
| Maintainers | samuraistacks |
| Keywords | ansi, terminal, color, colors, colour, console, cli, ansi-escape-codes, style, styles, formatting, tty |

## Links

- npm: https://www.npmjs.com/package/ansikit
- Repository: https://github.com/Luvella/AnsiKit
- Homepage: https://github.com/Luvella/AnsiKit#readme
- Issues: https://github.com/Luvella/AnsiKit/issues
- npm.io page: https://npm.io/package/ansikit

## 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

- 1.5.0 (latest) — 2020-10-16
- 1.4.0 — 2020-10-16
- 1.3.0 — 2020-10-12
- 1.2.0 — 2020-10-11
- 1.1.4 — 2020-09-22
- 1.1.3 — 2020-09-22
- 1.1.2 — 2020-09-16
- 1.1.1 — 2020-09-16
- 1.1.0 — 2020-09-16
- 1.0.3 — 2020-09-13
- 1.0.1 — 2020-09-10
- 1.0.0 — 2020-09-10
- 0.0.0 — 2020-09-10

## README

<h1 align="center">AnsiKit</h1>

<blockquote align="center">🎨 The ultimate terminal ANSI kit.</blockquote>

<p align="center">
<img src="https://forthebadge.com/images/badges/built-with-love.svg">
<br>
AnsiKit is a small and simple library for setting attributes and reading information about a terminal.  
It is very convenient due to having a consistent API and coverage for every sensible ANSI code.  

AnsiKit simply prints escapes to the terminal for the user, but also results in cleaner looking code.  
Note: If a terminal is not xterm-compatible some functions may not work as intended or just won't work at all.  
(For example the standard Windows `cmd`, but [Windows Terminal](https://github.com/microsoft/terminal) should have better results.)</p>

# Table of Contents
- [Install](#install)
- [Example](#example)
- [Styles](#styles)
- [Links](#links)
- [Contributing](#contributing)

# Install
`npm install ansikit`
 
# Example
```js
const ansikit = require('ansikit');

// The format function takes color tags and replaces it with color codes.
const text = ansikit.format('{underline}Hello {red}world!');
console.log(text);
```

# Styles
A style can be used in a format function like: `{style}` for example `{bold}`.
### Modifiers
`reset`  
`bold`  
`bold-off`  
`dim` or `faint`  
`italic`  
`underline`  
`underline-off`  
`invert` or `reverse`  
`strike` or `strikethrough`  

### Colors
`black`  
`red`  
`green`  
`yellow`  
`blue`  
`magenta`  
`cyan`  
`white`  

`black-bg`  
`red-bg`  
`green-bg`  
`yellow-bg`  
`blue-bg`  
`magenta-bg`  
`cyan-bg`  
`white-bg`  

`bright-black` or `grey` or `gray`  
`bright-red`  
`bright-green`  
`bright-yellow`  
`bright-blue`  
`bright-magenta`  
`bright-cyan`  

# Links
- Documentation: https://luvella.github.io/AnsiKit

# Contributing
If you would like to contribute, be sure to:
- Lint with our ESLint config
- Add JSDoc (if adding a new function)

And make a pull request!  

## Developing
```sh
git clone https://github.com/Luvella/AnsiKit
cd AnsiKit
npm i
npm i eslint -g # For linting (if you don't have it installed)
# After making changes:
eslint lib/
```

If you aren't contributing code you can always open an issue.
# License
AnsiKit is licensed under the MIT license.  
[Read here](LICENSE) for more info.

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