# ansi-highlight

> js syntax-highlighting for the terminal

Latest version **1.0.2** (published 2013-10-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install ansi-highlight
pnpm add ansi-highlight
yarn add ansi-highlight
bun add ansi-highlight
```

## 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.2 |
| Published | 2013-10-23 |
| First published | 2013-10-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Dominic Tarr |
| Maintainers | dominictarr |

## Links

- npm: https://www.npmjs.com/package/ansi-highlight
- Repository: https://github.com/dominictarr/ansi-highlight
- Issues: https://github.com/dominictarr/ansi-highlight/issues
- npm.io page: https://npm.io/package/ansi-highlight

## Dependencies (2)

- [colors](https://npm.io/package/colors.md) ~0.6.2
- [js-tokenizer](https://npm.io/package/js-tokenizer.md) ~1.3.1

## Recent versions

- 1.0.2 (latest) — 2013-10-23
- 1.0.1 — 2013-10-23
- 1.0.0 — 2013-10-23

## README

# ansi-highlight

highlight javascript in the terminal

# example

``` js
var highlight = require('ansi-highlight')
var js = require('fs').readFileSync(__filename, 'utf8')
console.log(highlight(js))
```

# see also

ansi-highlight uses regular expressions to tokenize javascript.
this is very fast and simple, but is incorrect is a few weird edgecases.
If need something to be completely correct, use [cardinal](https://github.com/thlorenz/cardinal)
which uses esprima to parse the javascript.

## License

MIT

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