fast-wrap-ansi

A tiny and fast text wrap library which takes ANSI escapes into account.

MIT 8 个版本
安装
npm install fast-wrap-ansi
yarn add fast-wrap-ansi
pnpm add fast-wrap-ansi
bun add fast-wrap-ansi
README

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

版本列表
0.2.2 2026-05-19
0.2.0 2025-09-30
0.1.6 2025-09-29
0.1.3 2025-08-04
0.1.2 2025-08-04
0.1.1 2025-08-04
0.1.0 2025-08-04
0.0.1 2025-08-03