Skip to content

Algorithmus/trunc-text

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

📏 truncate text by length, doesn't cut words

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%