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

1.0.2 • Public • Published

Tiny Truncate

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

Install

npm install --save tiny-truncate

Usage

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

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

License

MIT © Fabio Spampinato

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    16,537
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    16,537
  • 1.0.1
    4
  • 1.0.0
    1

Package Sidebar

Install

npm i tiny-truncate

Weekly Downloads

16,542

Version

1.0.2

License

none

Unpacked Size

3.68 kB

Total Files

9

Last publish

Collaborators

  • fabiospampinato