We’ve just published a new npm package, string-truncator. First and foremost, it’s for our own use. A picture is worth a thousand words; here’s our <aside>, before and after:
The string truncation is optimised to fit in as much letters as possible within “X line length across Y lines”. Check it out!