ansi-truncate
A tiny function for truncating a string that may contain ANSI escape sequences.
Last updated a year ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install ansi-truncate 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.4.0                                ...           latest (a year ago)

8 Versions

  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.0                                ...           2 years ago
  • 1.1.2                                ...           3 years ago
  • 1.1.1                                ...           3 years ago
  • 1.1.0                                ...           3 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 17
Today 0
This Week 0
This Month 11
Last Day 0
Last Week 4
Last Month 0
Dependencies (1)
Dev Dependencies (3)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE