ansiparser 1.0.2 ansiparser: ^1.0.2 copied to clipboard
A convenient library for converting ANSI escape sequences into text or HTML.
AnsiParser-dart
The AnsiParser library implemented in Dart.
📖 Description #
Parse ANSI escape sequences into screen outputs. This library implements a parser that processes escape sequences like a terminal, allowing you to convert them into formatted text or HTML.
📦 Installation #
AnsiParser is available on Pub:
pub add ansiparser
🎨 Usage #
import 'package:ansiparser/ansiparser.dart' as ansiparser;
void main() {
final ansipScreen = ansiparser.newScreen();
ansipScreen.put('\x1b[1;6H-World!\x1b[1;1HHello');
ansipScreen.parse();
final converted = ansipScreen.toFormattedString();
print(converted); // ['Hello-World!']
}