Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

string-truncator in action

by Roy Revelt   ·   posted on Thursday, 16 June 2022   ·   a thoughtmeta

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:

Fig 1. The aside titles, before and after implementing the string-truncator
Fig 1. The aside titles, before and after implementing the string-truncator

The string truncation is optimised to fit in as much letters as possible within “X line length across Y lines”.
Check it out!

↑ back to top
older newer

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab