简体   繁体   English

有没有办法在 Node REPL 中获取函数的签名/文档?

[英]Is there a way to get signature/documentation of a function in Node REPL?

"Tab"ing the REPL gives me a list of functions, but often working with multiple languages, I forget the signature of common functions like fs.open , etc. Is there anyway to show these in the REPL? “标签” REPL 给了我一个函数列表,但经常使用多种语言,我忘记了fs.open等常见函数的签名。无论如何在 REPL 中显示这些?

Thanks to auto-complete in editors, they seem to be fine.多亏了编辑器中的自动完成功能,它们似乎没问题。 But REPL for writing some quick script, I have pull up the node documentation each time for simple things.但是 REPL 用于编写一些快速脚本,我每次都会为简单的事情拉出节点文档。

Is there a better way to deal with this?有没有更好的方法来处理这个问题?

This semi official project developed under the node umbrella on GitHub offers a few improvement over the default REPL while used interactively:这个在 GitHub 节点伞下开发的半官方项目在交互使用时提供了对默认 REPL 的一些改进:

https://github.com/nodejs/repl https://github.com/nodejs/repl

Syntax highlighting is enabled for the input, basic functions signatures are displayed as hints.为输入启用语法高亮显示,基本函数签名显示为提示。

As stated in this issue, its future is still uncertain, but it's already quite usable in the current state: https://github.com/nodejs/repl/issues/46如本期所述,它的未来仍然不确定,但在当前状态下它已经非常可用: https : //github.com/nodejs/repl/issues/46

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

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