# keyword-miner

> Extract a list of keywords from a website, sorted by word count.

Latest version **0.4.3** (published 2016-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install keyword-miner
pnpm add keyword-miner
yarn add keyword-miner
bun add keyword-miner
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2016-01-02 |
| First published | 2015-12-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 53 |
| Author | Mateo Gianolio |
| Maintainers | mateogianolio |

## Links

- npm: https://www.npmjs.com/package/keyword-miner
- Repository: https://github.com/mateogianolio/keyword-miner
- Homepage: https://github.com/mateogianolio/keyword-miner#readme
- Issues: https://github.com/mateogianolio/keyword-miner/issues
- npm.io page: https://npm.io/package/keyword-miner

## Dependencies (2)

- [cheerio](https://npm.io/package/cheerio.md) ^0.19.0
- [text-miner](https://npm.io/package/text-miner.md) ^1.0.5

## Recent versions

- 0.4.3 (latest) — 2016-01-02
- 0.4.2 — 2016-01-02
- 0.4.1 — 2016-01-01
- 0.4.0 — 2016-01-01
- 0.3.5 — 2015-12-28
- 0.3.4 — 2015-12-28
- 0.3.3 — 2015-12-28
- 0.3.2 — 2015-12-28
- 0.3.1 — 2015-12-28
- 0.3.0 — 2015-12-28
- 0.2.0 — 2015-12-28
- 0.1.7 — 2015-12-28
- 0.1.6 — 2015-12-27
- 0.1.5 — 2015-12-27
- 0.1.4 — 2015-12-27
- … 4 more at https://npm.io/package/keyword-miner/versions

## README

# keyword miner

Extract a list of keywords from a website, sorted by word count. Uses [text-miner](https://github.com/Planeshifter/text-miner) and [cheerio](https://github.com/cheeriojs/cheerio) for HTML/text parsing.

Top 10 keywords for https://en.wikipedia.org/wiki/Data_mining:

![Example data](plot.png)

### Usage

```bash
$ npm install keyword-miner
```

```javascript
/**
 * keyword-miner exports a function with the following params:
 * @param {String|Object} url string or options object
 * @param {Function} done
 **/
var miner = require('keyword-miner');

var options = {
  site: 'https://en.wikipedia.org/wiki/Data_mining',

  // only include words with at least n occurences, default 0 (no threshold)
  threshold: 5,

  // limit output count, default 0 (no limit)
  limit: 20,

  // css element(s) to get keywords from, default 'body'
  element: 'body',

  // exclude keywords, default []
  exclude: []
};

// call function and print results when done
miner(
  options,
  (error, words) => {
    if (error)
      throw error;

    console.log('words:', words);
  }
);
```

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