Cut off a string if too long
You always want to cut off long strings.
$ npm install --save text-ellipsis
var ellipsis = require('text-ellipsis');
var short = ellipsis('a very long text', 10);
console.log(short);
// "a very ..."
var short = ellipsis('a very long text', 10, { side: 'start' });
console.log(short);
// "...ng text"
var short = ellipsis('a very long text', 10, { ellipsis: ' END' });
console.log(short);
// "a very END"