truncate text by length, doesn't cut words
using npm
.
npm install -S trunc-text
- fast
- truncates by complete words, not just by characters
Returns the result of truncating the provided text
by limit
.
Maximum amount of text characters allowed. When the limit
is reached, the algorithm will trace back to the last word separator and trim the rest into a …
glyph.
MIT