parse7
v3.0.2
Published
A cross-platform lightweight, efficient HTML parser
Downloads
5
Readme
parse7
Install
npm i parse7 -S
# or yarn add parse7
Usage
import parse7 from 'parse7'
// OR const parse7 = require('parse7')
parse7(html, handlers)
API
parse7(html, handlers)
html
- Type:
string
- Required:
true
handlers
Type:
{ [hook: string]: function }
Required:
true
Currently there are 4 hooks:
- tagStart(name: string, attrs: Array<{ name: string, value: string}>)
- tagEnd(name: string)
- comments(comment: string)
- chars(char: string)
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
parse7 © ulivz, Released under the MIT License. Authored and maintained by ulivz with help from contributors (list).
github.com/ulivz · GitHub @ulivz