【问题标题】:nodejs how to print console that sticks on topnodejs如何打印粘在顶部的控制台
【发布时间】:2013-10-26 09:05:11
【问题描述】:

让我说我想做

有时像 linux 或 unix TOP 使用 nodejs。

例子

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

这样屏幕就不会掉下来了

// 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

我从哪里开始?有什么好的工具吗?

【问题讨论】:

    标签: node.js console-application command-line-interface console.log


    【解决方案1】:

    Linux 中的 Top 是使用 ncurses 库实现的。这里有一个为 ncurses 提供 Node.js 绑定的项目:https://github.com/mscdex/node-ncurses

    【讨论】:

    • 感谢 ksimons,让我们再等一会其他答案,太棒了。
    【解决方案2】:

    如果您想要原生解决方案,请尝试charm,但它肯定不如 ncurses 强大。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-17
      • 1970-01-01
      • 2013-01-21
      • 2011-04-23
      • 2012-03-04
      • 2014-08-28
      • 1970-01-01
      • 2014-07-23
      相关资源
      最近更新 更多