Get text content from a HTML string [5] (version: 5)
Benchmark.js
Check different ways of getting text content from a HTML string. Tests with unsafe and safe ways.
Comparing performance of:[Unsafe] HTML string to text via creating an unattached DOM element. vs [Unsafe] HTML string to text via reusing an unattached DOM element. vs [Safe] HTML string to text via creating and using a DOMParser vs [Safe] HTML string to text via reusing a DOMParser vs [Safe] HTML string to text via the a new Document vs [Safe] HTML string to text via the a cached Document vs [Safe] HTML string to text via the DOMPurify library