npm.io
0.2.2 • Published 2 months ago

fast-wrap-ansi

Licence
MIT
Version
0.2.2
Deps
1
Size
10 kB
Vulns
0
Weekly
0
Stars
11

fast-wrap-ansi

Wordwrap a string, taking ANSI escape codes into account.

A fast, light fork of the wrap-ansi package.

Install

npm i -S fast-wrap-ansi

Usage

import {wrapAnsi} from 'fast-wrap-ansi';

const str = 'This is a string with some \x1b[31mANSI\x1b[39m codes.';
const wrapped = wrapAnsi(str, 20);
console.log(wrapped);

License

MIT

Keywords