1.1.5 • Published 2 years ago
dom-parser v1.1.5
dom-parser
Fast, tiny, zero-dependency DOM parser based on RegExps
Installation
npm install dom-parser
Usage
import { parseFromString } from 'dom-parser';
const html = await fs.readFileAsync('htmlToParse.html');
// Getting DOM model
const dom = parseFromString(html);
// Searching Nodes
const rootNode = dom.getElementById('rootNode');
const childNodes = rootNode.getElementsByClassName('childNodeClass');
API
Dom
Implemented methods
- getElementById
- getElementsByClassName
- getElementsByTagName
- getElementsByName
Node
Implemented properties
- nodeType
- nodeName
- childNodes
- firstChild
- lastChild
- parentNode
- attributes
- innerHTML
- outerHTML
- textContent
Implemented methods
- getAttribute
- getElementById
- getElementsByClassName
- getElementsByTagName
- getElementsByName
Usage - https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement
Contributing
Issues and pull requests are welcome!
1.1.1
2 years ago
1.0.2
2 years ago
1.1.0
2 years ago
1.0.9
2 years ago
1.0.8
2 years ago
1.0.7
2 years ago
1.1.5
2 years ago
1.0.6
2 years ago
1.1.4
2 years ago
1.0.5
2 years ago
1.1.3
2 years ago
1.0.4
2 years ago
1.1.2
2 years ago
1.0.0-beta
2 years ago
1.0.10
2 years ago
0.1.6
6 years ago
0.1.5
10 years ago
0.1.4
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.2
10 years ago
0.0.1
10 years ago
0.2.0
11 years ago