https://github.com/43081j/fast-wrap-ansi
A tiny and fast library for word wrapping terminal output.
https://github.com/43081j/fast-wrap-ansi
Last synced: 8 months ago
JSON representation
A tiny and fast library for word wrapping terminal output.
- Host: GitHub
- URL: https://github.com/43081j/fast-wrap-ansi
- Owner: 43081j
- License: mit
- Created: 2025-08-03T23:26:14.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-08-11T02:58:44.000Z (8 months ago)
- Last Synced: 2025-08-11T15:37:11.108Z (8 months ago)
- Language: TypeScript
- Size: 178 KB
- Stars: 5
- Watchers: 0
- Forks: 2
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-e18e - fast-wrap-ansi - Word wrapping with ANSI support. (Utilities / Command Line Interfaces (CLI))
README
# fast-wrap-ansi
Wordwrap a string, taking ANSI escape codes into account.
A fast, light fork of the `wrap-ansi` package.
## Install
```bash
npm i -S fast-wrap-ansi
```
## Usage
```ts
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