0

I am capturing output from a TTY but it is full of ANSI escape codes, many of which move the cursor and rewrite part of the screen. I would like to be able to feed this string into a parser and have it resolve all the rewrites...

I have tried a couple of libraries such as anser but it looks to me like it just strips the ansi instead of resolving cursor moves when I call ansiToText. Any advice?

Thomas Dickey
  • 51,086
  • 7
  • 70
  • 105
refeniz
  • 525
  • 1
  • 5
  • 14

1 Answers1

-1

Aha! I finally found it: npm install terminal.js

My problem here was that I was looking for a 'parser' or a 'resolver' when I wanted an 'emulator'

¯\_(ツ)_/¯

refeniz
  • 525
  • 1
  • 5
  • 14