# keylight

> Highlight key content

Latest version **1.0.0** (published 2019-07-20) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-07-20 |
| First published | 2019-07-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 126.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | naecoo |
| Maintainers | naeco |
| Keywords | highlight, keyword, typescript |

## Links

- npm: https://www.npmjs.com/package/keylight
- Repository: https://github.com/naecoo/keylight
- Issues: https://github.com/naecoo/keylight/issues
- npm.io page: https://npm.io/package/keylight

## Alternatives

- [@oh-my-pi/pi-natives](https://npm.io/package/@oh-my-pi/pi-natives.md) — 51.8K weekly downloads
- [@capgo/capacitor-light-sensor](https://npm.io/package/@capgo/capacitor-light-sensor.md) — 3.0K weekly downloads
- [@heyhuynhgiabuu/pi-diff](https://npm.io/package/@heyhuynhgiabuu/pi-diff.md) — 492 weekly downloads
- [@lotsa/verdant-lang-asm](https://npm.io/package/@lotsa/verdant-lang-asm.md) — 38 weekly downloads
- [new-era-syntax](https://npm.io/package/new-era-syntax.md) — 20 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-07-20

## README

# To highlight some key content with color
### demo
- demo1
![demo1](/img/demo1.gif)
- demo2 
![demo2](/img/demo2.gif)

### usage
```javascript
// install
yarn add keylight

// import 
import keylight from 'keylight'

// use
const kl = new keylight('#f701bc')
const content = "hello world"
const key = "hello"
const hightContent = kl.match(content, key)
// => '<span style="color:#f701bc;">hello</span> world'

// change color
kl.color = '#ababab'
const hightContent = kl.match(content, key)
// => '<span style="color:#ababab;">hello</span> world'

// additional operating
const upperCase = val => val.toUpperCase()
const hightContent = kl.match(content, key, uppercase) 
// => '<span style="color:#ababab;">HELLO</span> world'

```

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