tiny-truncate
A tiny function for truncating a string which may containg ANSI escapes, with automatic terminal width detection.
Last updated a year ago by fabiospampinato .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install tiny-truncate 
SYNC missed versions from official npm registry.

Tiny Truncate

A tiny function for truncating a string which may containg ANSI escapes, with automatic terminal width detection.

Install

npm install tiny-truncate

Usage

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

// Let's truncate a string, spanning at most the entire width of the terminal

truncate ( colors.red ( '---'.repeat ( 1000 ) ) ); // Some red dashes that don't overflow the width of the terminal

License

MIT © Fabio Spampinato

Current Tags

  • 1.0.5                                ...           latest (a year ago)

6 Versions

  • 1.0.5                                ...           a year ago
  • 1.0.4                                ...           a year ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
Maintainers (1)
Downloads
Total 10
Today 0
This Week 0
This Month 6
Last Day 0
Last Week 3
Last Month 0
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

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