# html-cruncher

> HTML parser

Latest version **0.2.14** (published 2017-05-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-cruncher
pnpm add html-cruncher
yarn add html-cruncher
bun add html-cruncher
```

## 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.2.14 |
| Published | 2017-05-27 |
| First published | 2015-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Aleem Haji |
| Maintainers | eagerod |
| Keywords | html, parser |

## Links

- npm: https://www.npmjs.com/package/html-cruncher
- Repository: https://github.com/Eagerod/html-cruncher
- Homepage: https://github.com/Eagerod/html-cruncher#readme
- Issues: https://github.com/Eagerod/html-cruncher/issues
- npm.io page: https://npm.io/package/html-cruncher

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.2.14 (latest) — 2017-05-27
- 0.2.13 — 2017-05-11
- 0.2.12 — 2017-04-12
- 0.2.11 — 2017-04-12
- 0.2.10 — 2017-04-12
- 0.2.9 — 2016-04-23
- 0.2.8 — 2016-04-21
- 0.2.7 — 2016-04-20
- 0.2.6 — 2016-04-19
- 0.2.5 — 2016-04-17
- 0.2.4 — 2016-04-15
- 0.2.3 — 2016-04-15
- 0.2.2 — 2016-04-15
- 0.2.1 — 2016-04-14
- 0.2.0 — 2016-03-20
- … 9 more at https://npm.io/package/html-cruncher/versions

## README

# html-cruncher

[![Build Status](https://travis-ci.org/Eagerod/html-cruncher.svg?branch=master)](https://travis-ci.org/Eagerod/html-cruncher)

html-cruncher is a light-weight, dependency-free package for parsing HTML documents. 
It was born out of the necessity to have an easy interface for finding certain elements in a page's DOM.

## Usage

Start out by installing html-cruncher using npm:

    npm install html-cruncher

Set up your node project to use the html-cruncher:

```javascript
var request = require("request");
var HTMLElement = require("html-cruncher");

request("http://www.google.com", function(err, response, body) {
	var document = HTMLElement.fromString(body);
})
```

### Features

Once you've gotten a parsed DOM, you can search against it using the same methods
that you'd typically use in browser-side JavaScript. 

- `getElementById`
- `getElementsByClassName`
- `getElementsByTagName`

There's also a small subset of XPath available through the `xpath` method on `HTMLElement`. 
You can select elements in a DOM by providing some simple xpath commands:

- Element selection, direct child and full DOM.
- Predicates
    - Select node at index.
    - Only select text nodes.
    - Attribute equality.

More will be added as needs arise, but for now, this is all that's needed all uses of this package I've been informed of.

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