All Projects → bevacqua → Trunc Text

bevacqua / Trunc Text

Licence: mit
📏 truncate text by length, doesn't cut words

Programming Languages

javascript
184084 projects - #8 most used programming language

trunc-text

Build Status

truncate text by length, doesn't cut words

install

using npm.

npm install -S trunc-text

features

  • fast
  • truncates by complete words, not just by characters

trunc(text, limit)

Returns the result of truncating the provided text by limit.

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.

related

license

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].