Claudio
Claudio

Reputation: 5980

Node.js: simplest way to create a "scrolling window + textarea" console application?

I'm writing a console application with Node.js. Think about it like a "tail -f" of some sort of file, but where you can also enter some "commands" which will act over the list.

A two windows console application: the top one with an unattended scrolling of rows, and the second one where I can enter text with the help of Readline.

Do you think I need ncurses or is there could be another - even more low level - way to directly address the screen (oh man, I remember the Int21h of DOS memories)?

Edit: I published the application: https://github.com/claudioc/jecho (still no "windows"... I just try to be smart about the \n :))

Upvotes: 2

Views: 1387

Answers (2)

john_fries
john_fries

Reputation: 215

Does it really need to be a single application? You could just use screen. Split the screen horizontally, and have each window talking to node separately. The top window can just be a loop that polls node.js and prints the output.

Upvotes: 0

saml
saml

Reputation: 6802

Yeah, you'd need ncurses or termio or something like that. What you're trying to do would require you to control the terminal i/o buffers yourself, definitely lower level than node gives you by default.

Upvotes: 2

Related Questions