# query-html

> Query HTML with CSS Selectors.

Latest version **1.0.0** (published 2021-05-20) · MIT license · 0 weekly downloads

## Install

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

## 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.0 |
| Published | 2021-05-20 |
| First published | 2021-05-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Richard van der Dys |
| Maintainers | dijs |
| Keywords | query, html, select, css, parse |

## Links

- npm: https://www.npmjs.com/package/query-html
- npm.io page: https://npm.io/package/query-html

## Dependencies (2)

- [hyntax](https://npm.io/package/hyntax.md) ^1.1.9
- [css-what](https://npm.io/package/css-what.md) ^5.0.0

## 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

- 1.0.0 (latest) — 2021-05-20

## README

[![NPM Version](https://img.shields.io/npm/v/query-html.svg)](https://www.npmjs.com/package/query-html)

<a href="https://www.buymeacoffee.com/2tmRKi9" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-yellow.png" alt="Buy Me A Coffee" height="41" width="174"></a>

QueryHTML is a fast and lightweight HTML query library.

## Examples

```js
const query = queryHtml(htmlString);

query.find('.foo').text; // -> inner text of this element
query.find('.foo ul li').eq(3).attr('for'); // -> read attributes
query.find('.foo ul li').first.href; // -> built in support for common attributes
query.find('div a').hasClass('foo'); // -> check for class names
query.find('.foo ul').children; // -> access to child elements in raw form
query.find('.foo ul').name; // -> access element properties
```

## Install

```bash
npm install query-html
```

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