Skip to content

Latest commit

 

History

History

toEllipsis

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

@plexis/to-ellipsis

Truncates the input text to the desired length.

Installation npm i @plexis/to-ellipsis

Usage

import toEllipsis from '@plexis/to-ellipsis';

toEllipsis('foo'); // retruns 'foo'
toEllipsis('foo', 1); // retruns  'f..'
toEllipsis('foo', 3); // retruns 'foo'
toEllipsis('Last night I dreamt I went to Manderley again.', 5); // retruns 'Last ...'

Aliases

import toEllipsis from '@plexis/to-ellipsis';
import {toEllipsis, truncate, fit} from 'plexis';