# @wonderflow/lighter

> Highlight words in a HTML page with ease

Latest version **1.2.0** (published 2020-01-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @wonderflow/lighter
pnpm add @wonderflow/lighter
yarn add @wonderflow/lighter
bun add @wonderflow/lighter
```

## 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.2.0 |
| Published | 2020-01-31 |
| First published | 2020-01-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 328.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Wonderflow |
| Maintainers | bitliner |

## Links

- npm: https://www.npmjs.com/package/@wonderflow/lighter
- Repository: https://github.com/wonderflow-bv/lighter
- Homepage: https://github.com/wonderflow-bv/lighter#readme
- Issues: https://github.com/wonderflow-bv/lighter/issues
- npm.io page: https://npm.io/package/@wonderflow/lighter

## Recent versions

- 1.2.0 (latest) — 2020-01-31
- 1.1.0 — 2020-01-31
- 1.0.0 — 2020-01-31

## README

![Example](/images/lighter-logo.png)

Highlight words in a HTML page with ease.

![Example](/images/examples.png)

## Install

```bash
$ npm install @wonderflow/lighter
```

## `lighter({ node, text })`

The `lighter` function accepts two arguments:

- `node` (required): a DOM node reference
- `text` (required): the text you need to highlight

```js
const lighter = require('@wonderflow/lighter')

lighter({ node: document.querySelector('.test'), text: 'dolor' })
```

## Bundling

On local examples we're using [browserify](http://browserify.org/) to build the `bundle.js` file, but you can use any existing bundler with ease like [Webpack](https://webpack.js.org/) or [Parcel](https://parceljs.org/).

## Examples

If you run:

```bash
$ npm run examples
```

An [http-server](https://www.npmjs.com/package/http-server) instance will boot locally with some examples (look at source code)

## Author

[Wonderflow](https://www.wonderflow.co)

## License

This project is licensed under the MIT license. See the [LICENSE](LICENSE) file for more info.

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