简体   繁体   English

在 Nodemon 运行时清除终端?

[英]clearing terminal while Nodemon is running?

Is there any way to clear terminal while nodemon is running?有没有办法在nodemon运行时清除终端? I am using Ubuntu 18.04我正在使用Ubuntu 18.04

Insert the following code into the nodemon.json file.将以下代码插入到nodemon.json文件中。

 { "events": { "start": "clear" } }

This is what the nodemon events are for.这就是 nodemon 事件的用途。 You can include either a global or local nodemon.json file as per the following to do what you're after.您可以按照以下内容包含全局或本地nodemon.json文件来执行您的操作。

   {
      "events": {
        "start": "echo -ne '\\ec'"
      }
    }

When you type a & behind your command it will be executed in the background当您在命令后面键入&时,它将在后台执行

command &

https://www.maketecheasier.com/run-bash-commands-background-linux/ https://www.maketecheasier.com/run-bash-commands-background-linux/

You can use console.clear() in your code while running nodemon.您可以在运行 nodemon 时在代码中使用console.clear()

No settings or files needed.无需设置或文件。 All OS works.所有操作系统都有效。

For macs, if CTRL+K doesn't work, try command+K (it does also work for react-scripts)对于 mac,如果CTRL+K不起作用,请尝试command+K (它也适用于 react-scripts)

I'm posting an answer, because I can't yet comment posts, and for me CTRL+K , as was suggested, doesn't work我正在发布答案,因为我还不能评论帖子,而且对我来说CTRL+K ,正如建议的那样,不起作用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM