"We sometimes need to display a shorter version of a text/content so that it fits to the layout as expected (like the "read more" links shown for truncated content).
Cutter.js is a JavaScript class that allows us to accomplish this on the client-side without losing markup.
The class cuts the content to the number of requested words and if needed puts a link to open the full content again and, if wanted, places a link to open the full content.
It is a standalone + lightweight resource (1.5kb gzipped) and works cross-browser."