Node.js REPL 续行 [英] Node.js REPL continuation lines

查看:62
本文介绍了Node.js REPL 续行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在使用 node.js repl 时,有没有办法退出节点过度热衷的续行?

When working with the node.js repl, is there a way to quit a continuation line that node is being over zealous with?

例如:

$ node
> {- -}
... 

几乎所有您可以输入的内容都会为您提供另一个续行.Ctrl+D 退出整个 repl.

And pretty much everything you can type then gives you another continuation line. Ctrl+D quits the whole repl.

显然我不想一直输入 {- -} ,但我确实发现当我使用 repl 进行实验时,我经常输入错误的内容.然后我必须退出 repl,并释放内存中的所有位.

Obviously I don't want to go around typing {- -} all the time, but I do find I often type something erroneous when I'm using the repl to experiment. Then I have to quit the repl, and loose all the bits in memory.

推荐答案

您也可以输入:

.break

类型

.help

对于更多 REPL 选项....clear 命令也可能很有用,因为它会中断并清除本地上下文,以防您想省去退出和重新启动 repl 的麻烦.

for more REPL options... the .clear command may also be useful because it breaks and clears the local context, in case you want to save yourself the trouble of exiting and restarting the repl.

这篇关于Node.js REPL 续行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆