OK Text Search
A module for searching for text. Useful if you need to search a large piece of text for multiple strings.
Don't know if it's the fastest but it's OK. It's quite small (3k uncompressed), doesn't have any dependencies so should work in the browser fine. It's worth checking if something like this is the best fit for you as with a low amount of phrases and a small piece of text to search indexOf is often faster.
npm install ok-text-search
; const textSearch= 'something''another thing';textSearch; textSearch; const results = textSearch;//[{index:18, text:'something'}]
If you'd like to check performance there is a simple benchmarking script.
npm run benchmark