A super fast & tiny HTML5 parser
npm install html5parserhtml5parser is a super fast and tiny HTML5 parser.
- Fast: maybe the fastest one you can find on GitHub.
- Tiny: the fully packaged bundle size is less than 5kb.
- Cross platform: works in the modern browsers and Node.js.
- HTML5 only: any thing not in the specification will be ignored.
- Accurate: every token could be located in source file.
- Installation
- Quick start
- API Reference
- Core
- tokenize()
- parse()
- Utilities
- walk()
- safeHtml()
- safeHtmlDefaultOptions
- Warnings
- Benchmark
1. Package manager
``bash
npm i -S html5parser
# or var yarn
yarn add html5parser
`
2. CDN
`html`

`typescript jsx
import { parse, walk, SyntaxKind } from 'html5parser';
const ast = parse('