Question

lets say i want to make

sometime like linux or unix TOP using nodejs.

example

EXMPLE APP

ram usage : 30MB
processor usage : 20%

// above this line refreshed and but a fixed position
---------- LOGS ------------
// below this line is refreshed and max last 5 console.logs

example : server down at x
example : server down at y
example : server down at y
example : server down at y
example : server down at y

so the screen wont go down so

// missing ram usage and processor usage as the page go down
example : server down at x
example : server down at y
example : server down at y
example : server down at y
example : server down at y
example : server down at x
example : server down at y
example : server down at y
example : server down at y
example : server down at y

where do i start?, is there any good tools?

Était-ce utile?

La solution

Top in Linux is implemented using the ncurses library. There's a project providing Node.js bindings for ncurses here: https://github.com/mscdex/node-ncurses

Autres conseils

If you want a native solution, try charm, but it's definitely less powerful then ncurses.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top