Skip to content

andrevantunes/string-crop-prototype

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published