AnsiParser-dart

The AnsiParser library implemented in Dart.

Pub Version GitHub License

📖 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!']
}

📜 License

GitHub License

Libraries

ansiparser