accent-folding
It wraps string fragment in <b>
html tag by default.
You can use custom folding tag by adding the name of your tag as third parameter (2nd example).
install with npm:
npm install accent-folding
Example code:
accentFoldedHighlight("Fulanilo López", "lo"); // --> "Fulanilo López"
accentFoldedHighlight("Fulanilo López", "lo", "strong"); // --> "Fulanilo López"