1.2.0 • Published 5 months ago

ansi-truncate v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

ANSI Truncate

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

Install

npm install ansi-truncate

Usage

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

// Let's truncate a string to a visual width of 2

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

License

MIT © Fabio Spampinato

1.2.0

5 months ago

1.1.1

1 year ago

1.1.2

1 year ago

1.1.0

1 year ago

1.0.1

3 years ago

1.0.0

3 years ago