1.0.0 • Published 2 years ago
@aleeselosa/truncatify v1.0.0
What is this?
This library can be used to truncate long descriptions and cut it to the nearest word ending. It also considers the included tags inside the container.
Installation
npm i truncatify --save
Then...
import Truncatify from 'truncatify';
let truncator = new Truncatify({classes: ['.truncate'], limit: 200, truncationChars: '---' });
truncator.truncate();
Truncatify has 3 options, those are optional:
- classes - arrays of classes | (Defaults to
['.truncate']
) - limit - number | (Defaults to
200
) - truncationChars - string | (Defaults to
...
)
1.0.0
2 years ago