Skip to content

A tiny function for truncating a string that may contain ANSI escape sequences.

License

Notifications You must be signed in to change notification settings

fabiospampinato/ansi-truncate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ANSI Truncate

A tiny function for truncating a string that may contain ANSI escape sequences.

Install

npm install --save ansi-truncate

Usage

import colors from 'tiny-colors';
import truncate from 'ansi-truncate';

truncate ( colors.red ( 'foo' ), 2 ); // => Same as: colors.red ( 'f…' );

License

MIT © Fabio Spampinato

About

A tiny function for truncating a string that may contain ANSI escape sequences.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published