# fast-wrap-ansi

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

Latest version **0.2.2** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install fast-wrap-ansi
pnpm add fast-wrap-ansi
yarn add fast-wrap-ansi
bun add fast-wrap-ansi
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2026-05-19 |
| First published | 2025-08-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 10.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 11 |
| Author | James Garbutt |
| Maintainers | 43081j |
| Keywords | wrap, ansi, term, colors |

## Links

- npm: https://www.npmjs.com/package/fast-wrap-ansi
- Repository: https://github.com/43081j/fast-wrap-ansi
- Homepage: https://github.com/43081j/fast-wrap-ansi#readme
- Issues: https://github.com/43081j/fast-wrap-ansi/issues
- npm.io page: https://npm.io/package/fast-wrap-ansi

## Dependencies (1)

- [fast-string-width](https://npm.io/package/fast-string-width.md) ^3.0.2

## Alternatives

- [localforage](https://npm.io/package/localforage.md) — 6.2M weekly downloads
- [localforage-observable](https://npm.io/package/localforage-observable.md) — 30.8K weekly downloads
- [@y/y](https://npm.io/package/@y/y.md) — 30.1K weekly downloads
- [@metaobjectsdev/render](https://npm.io/package/@metaobjectsdev/render.md) — 3.5K weekly downloads
- [@ledgerhq/coin-algorand](https://npm.io/package/@ledgerhq/coin-algorand.md) — 1.1K weekly downloads

## Recent versions

- 0.2.2 (latest) — 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

## 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

---
_Source: https://npm.io/package/fast-wrap-ansi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
