# nodekogiri

> A libxmljs wrapper that acts like Nokogiri

Latest version **1.0.3** (published 2017-10-17) · ISC license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2017-10-17 |
| First published | 2017-10-17 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+4 in 1 direct dependencies) |
| Install scripts | no |
| Author | P Guardiario |
| Maintainers | pguardiario |

## Links

- npm: https://www.npmjs.com/package/nodekogiri
- Repository: https://github.com/monkeysuffrage/nodekogiri
- Homepage: https://github.com/monkeysuffrage/nodekogiri#readme
- Issues: https://github.com/monkeysuffrage/nodekogiri/issues
- npm.io page: https://npm.io/package/nodekogiri

## Dependencies (2)

- [libxmljs](https://npm.io/package/libxmljs.md) ^0.18.7
- [css-to-xpath](https://npm.io/package/css-to-xpath.md) ^0.1.0

## Recent versions

- 1.0.3 (latest) — 2017-10-17
- 1.0.2 — 2017-10-17
- 1.0.1 — 2017-10-17
- 1.0.0 — 2017-10-17

## README

# nodekogiri
This class is a wrapper to xmllibjs that acts like Nokogiri

## Install

```
npm install nodekogiri
```
## Usage
```
const { HTML } = require('nodekogiri')

let html = `
<div class="foo">My List</div>
<ul>
  <li>aaa</li>
  hi
  <li>bbb</li>
  <li>ccc</li>
</ul>
<div>xxx</div>
`
let doc = new HTML(html)

let data = doc.search('.foo').map(div => {
   return {
     title: div.text(),
     list: div.search('+ ul li').map(li => li.text())
   }
})

console.log(data)
```
It's only for extraction at this point (no DOM manipulation) and it can do some things that cheerio can't do (like the above example). It also performs a bit better than cheerio.
```
console.log(doc.at('.foo').class) // => foo
console.log('' + doc.at('.foo')) // => <div class="foo">My List</div>
```

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