I'm creating a console app with Node.js which is going to have a TUI (Text User Interface). But I want to run it in a full screen mode inside the terminal (I don't know if it's the correct way to say it) instead of just printing stuff in the same layout that we run the app. Like how Vim, htop or similar applications work, and it seems like they are run in a different layout.
Actually, I'm more interested to know how it happens. I mean, does terminal have different mode for running an app? Or it's programmer's job to save everything that is on the screen, then use the whole terminal, and when he's done, write back everything that were there before?
It's also fine if you just recommend me a library that does this (I can check its code to understand how it works)