kot*_*ane 2 javascript node.js read-eval-print-loop
node我在终端上使用或打开 REPL node -i。
玩完之后,我\xe2\x80\x99d喜欢清除这个REPL中的所有内容(主要是我创建的JS\xe2\x80\xaf变量)。有命令可以做到这一点吗?我目前使用.exit后跟node,但我\xe2\x80\x99d 喜欢在不关闭并重新打开 REPL 的情况下执行此操作,并且该.clear命令似乎不起作用。
小智 5
创建一个新的 REPLServer 实例怎么样?
$ node -r repl -e "repl.start()"
> const x = 'hello';
undefined
> .clear
Clearing context...
> x
Uncaught ReferenceError: x is not defined
Run Code Online (Sandbox Code Playgroud)
REPLServer 是可定制的。请参阅此参考: https: //nodejs.org/api/repl.html。
| 归档时间: |
|
| 查看次数: |
700 次 |
| 最近记录: |