@aleeselosa/truncatify

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i @aleeselosa/truncatify

Weekly Downloads

1

Version

1.0.0

License

ISC

Unpacked Size

7.48 kB

Total Files

4

Last publish

Collaborators

  • aleeselosa