gpt4 book ai didi

node.js - 如何在 NodeJS REPL 中使用 "reverse interactive search"?

转载 作者:IT老高 更新时间:2023-10-28 23:27:18 25 4
gpt4 key购买 nike

我想在 NodeJS 中使用 reverse interactive search 通过 Ctrl + r REPL 就像在 bashirb.

Ctrl + r 没有触发交互式搜索。有没有办法在 Nodejs REPL 中使用该函数?

我使用的是 MacOS Sierra,NodeJS 的版本是 v8.5.0

最佳答案

此问题已在最近的 I pity the foo() 中得到解答博文...

Can reverse-search in commands history be used inside Node’s REPL?

Currently it seems like its not possible. The Node REPL does allow to persist the history into a file and later load it, but doesn’t allow to reverse-search it.

所以看来 REPL 本身并不支持反向历史搜索。

但是,您可以安装 rlwrap 实用程序并在 Node REPL 之上运行它以提供类似的功能。 REPL documentation该站点有一些基本说明可以帮助您启动和运行。我有点好奇幕后发生了什么,所以更多的谷歌搜索从 Learning Node: Moving to the Server Side 出现了这个部分其中更详细地介绍了与使用 rlwrap 相关的权衡。比如……

As helpful as rlwrap is, we still end up with undefined every time we type in an expression that doesn't return a value. However, we can adjust this, and other functionality, just by creating our own custom REPL, discussed next.

关于node.js - 如何在 NodeJS REPL 中使用 "reverse interactive search"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46714331/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com