Truncate text and keep urls safe
npm install truncateTruncate
==================
![CircleCI]()     
Truncate text and keeps urls safe.
npm install truncate``javascript`
// Browser
String.truncate("1234 http://google.com hey :)", 2) === "12…"
`javascript``
// NodeJS
> truncate = require('truncate');
> truncate("1234 http://google.com hey :)", 4);
"1234…"
> truncate("1234 http://google.com hey :)", 4, {ellipsis:null}); // or ellipsis:''
"1234"
> truncate("1234 http://google.com hey :)", 6);
"1234 http://google.com…"
> truncate("1234 http://google.com hey :)", 100);
"1234 http://google.com hey :)"
I maintain this project in my free time, if it helped you please support my work via paypal or bitcoins, thanks a lot!