Skip to content

cezarsmpio/resumetring

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Resumetring

A simple library to resume a string.

Install

npm install resumetring

Usage

require('resumetring');

// string str.resume(int max_length, str glue);
// defaults
// max_length 10
// glue '...'


var str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit."

str.resume(); // Lorem ipsu...

str.resume(20); // Lorem ipsum dolor si...

str.resume(20, ' [read more]'); // Lorem ipsum dolor si [read more]

Testing

Tests made with jest

npm test

License

MIT

About

A simple library to resume a string

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published