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

4 Versions

  • 1.0.3                                ...           a year ago
  • 1.0.2                                ...           4 years ago
  • 1.0.1                                ...           4 years ago
  • 1.0.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (1)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |