This is a library designed to build abstract syntax trees for LaTeX documents using JavaScript / TypeScript.
⚠ Warning
This project only parses a subset of what can be considered "canonical" LaTeX. As I see it, a full LaTeX parser would be a complete port of the TeX code, and I am not crazy enough to attempt that. Of course, we can still make something that works most of the time. This approach is similar to KaTeX, a Javascript library which focuses on math typesetting. This library focuses more on parsing text mode.
If you don't believe parsing LaTeX is necessarily difficult, prepare to be outsmugged: