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
$ cnpm 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.2.0                                ...           latest (a year ago)

6 Versions

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

Copyright 2013 - present © cnpmjs.org | Home |