← All repos

slice-ansi

Slice a string with ANSI escape codes

Browse cluster: Terminal & CLI Output Styling
70commits
13contributors
1languages

Tech stack & purpose

slice-ansi is a utility for slicing strings that contain ANSI escape codes while preserving the formatting. The project addresses the problem of manipulating styled terminal strings, where simple string slicing would break color and style information embedded in ANSI codes. It is built as a JavaScript/Node.js module installable via npm and works with styling libraries like chalk. The project is maintained by Sindre Sorhus and Josh Junon.

Community & reference links

Languages

JavaScript
100.0%

Contributors