1.0.2 • Published 5 years ago

string-crop-prototype v1.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
5 years ago

string-crop-prototype

It is a easy way to reduce a string and add "..." in the end, but only if the string is really long.

Examples

import 'string-crop-prototype'
//require('string-crop-prototype') //to ES5

const string1 = 'Some string of length 24'.crop(30) //nothing happens
const string2 = 'Another string of length longer than 30'.crop(30) //Another string of length longe...

console.log(string1) //Some string of length 24
console.log(string2) //Another string of length longe...