# highlight-es

> Highlight ECMAScript syntax for the console or any other medium.

Latest version **1.0.3** (published 2018-04-22) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2018-04-22 |
| First published | 2016-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 4.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ivan Nikulin |
| Maintainers | inikulin |
| Keywords | ES, JavaScript, ECMAScript, ES, ES6, ES2016, ES2015, syntax, highlight, highlighting, console |

## Links

- npm: https://www.npmjs.com/package/highlight-es
- Repository: https://github.com/inikulin/highlight-es
- Homepage: https://github.com/inikulin/highlight-es#readme
- Issues: https://github.com/inikulin/highlight-es/issues
- npm.io page: https://npm.io/package/highlight-es

## Dependencies (3)

- [chalk](https://npm.io/package/chalk.md) ^2.4.0
- [js-tokens](https://npm.io/package/js-tokens.md) ^3.0.0
- [is-es2016-keyword](https://npm.io/package/is-es2016-keyword.md) ^1.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads
- [aws-elasticsearch-connector](https://npm.io/package/aws-elasticsearch-connector.md) — 37.4K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-04-22
- 1.0.1 — 2017-01-25
- 1.0.0 — 2016-02-12

## README

# highlight-es
[![Build Status](https://api.travis-ci.org/inikulin/highlight-es.svg)](https://travis-ci.org/inikulin/highlight-es)

*Highlight ECMAScript syntax for the console or any other medium.*

## Install
```
npm install highlight-es
```

## Usage
```js
const highlight = require('highlight-es');

function testFunc () {
    const re    = /(.+) awesome$/;
    const match = 'You are awesome'.match(re);

    return match[1];
}

const code = testFunc.toString();

console.log('\n' + highlight(code));
```

 ⬇

![example](https://raw.githubusercontent.com/inikulin/highlight-es/master/media/example.png)


You can pass custom renderer to target other medium, e.g.:
```js
highlight(code, {
    string:     str => ...,
    punctuator: str => ...,
    keyword:    str => ...,
    number:     str => ...,
    regex:      str => ...,
    comment:    str => ...,
    invalid:    str => ...
});
```

## Related
[is-es2016-keyword](https://github.com/inikulin/is-es2016-keyword) - Determine if string is an ES2016 keyword.

## Author
[Ivan Nikulin](https://github.com/inikulin) (ifaaan@gmail.com)

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