ansi-truncate
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.2
    12,279
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.2
    12,279
  • 1.1.1
    4
  • 1.1.0
    2
  • 1.0.1
    7,712
  • 1.0.0
    3

Package Sidebar

Install

npm i ansi-truncate

Weekly Downloads

19,989

Version

1.1.2

License

none

Unpacked Size

6.35 kB

Total Files

15

Last publish

Collaborators

  • fabiospampinato