string-crop-prototype

1.0.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i string-crop-prototype

Weekly Downloads

1

Version

1.0.2

License

ISC

Unpacked Size

1.65 kB

Total Files

3

Last publish

Collaborators

  • andreantunesvieira