trunky - Basic truncation and string tools
Installation
npm install trunky
Usage
var truncate = truncateWithEllipsis; ; // Hello…; // Hello…
Note: the unicode character …
(\u2026
) is used by default. If your application does not support unicode or you would prefer a different ellipsis character, truncate()
takes an optional third argument which is the string to use:
; // Hello...; // Hello etc.
Credits
Paul Serby follow me on twitter
Licence
Licenced under the New BSD License