# strip-ansi

> Strip ANSI escape codes from a string

Source: https://talira.ai/catalog/strip-ansi-rvjxg9c5
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / terminal ui](https://talira.ai/categories/libraries/terminal-ui), [languages / javascript](https://talira.ai/categories/languages/javascript)
- Licence: MIT[^1]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Sindre Sorhus](https://talira.ai/orgs/sindresorhus.md)

strip-ansi removes ANSI escape codes (colours, styles, and OSC hyperlinks) from a string in JavaScript. Node.js now has `util.stripVTControlCharacters` built in; this package gives consistent behaviour across Node.js versions and environments. It's from the [Chalk](https://talira.ai/catalog/chalk-pf0cyh21.md) project, with a CLI (strip-ansi-cli) and a streaming version alongside.

## Links

- GitHub: https://github.com/chalk/strip-ansi

## Problems it solves

- remove terminal colour codes from a string in Node.js
- clean ANSI escape codes from CLI output before logging
- get plain text from colourised terminal output

## Features

- removes ANSI colour and style codes
- removes OSC hyperlink sequences
- consistent across Node.js versions

## Trust

Overall: 0.38 out of 1.
Signals: maintenance 0.46, adoption 0.54, momentum 0.19, community 0.46, backing 0.30, extensibility 0.00.

- last commit 2 months ago
- 1 commits in the last 90 days
- latest release v7.2.0 9 months ago
- 500 GitHub stars
- 13 contributors
- accepts sponsorship (Github, Github, Tidelift)
- backed by Sindre Sorhus

## Related

- Works with [Chalk](https://talira.ai/catalog/chalk-pf0cyh21.md)

## Alternatives

- [Chalk](https://talira.ai/catalog/chalk-pf0cyh21.md): Terminal string styling for Node.js: colours, backgrounds and text styles
- [colors.js](https://talira.ai/catalog/colors-js-e1vy93vd.md): Colours and styles for Node.js console output (npm package colors)

## Sources

[^1]: https://github.com/chalk/strip-ansi/blob/main/license (checked 29 Nov 2026)
