简体   繁体   English

如何使用 nodeJS 接收简单的单行用户输入?

[英]How to receive simple one-line user input with nodeJS?

I want to run a nodeJS application with my own very simple console, so my question is how can I achieve it in a straightforward way (typical of any programming language).我想用我自己非常简单的控制台运行一个 nodeJS 应用程序,所以我的问题是如何以一种直接的方式实现它(典型的任何编程语言)。

I've seen articles like How To Read User Input With NodeJS but I am not sure if there is a simple way already included.我看过诸如如何使用 NodeJS 读取用户输入之类的文章,但我不确定是否已经包含了一种简单的方法。

It looks unfinished, but it appears NodeJS does have a simpler way with its Readline library in version 5.3.它看起来还没有完成,但似乎 NodeJS 在 5.3 版本中使用其Readline 库确实有一个更简单的方法。

Other than that, I think the article you linked to covers the basics pretty well.除此之外,我认为您链接到的文章很好地涵盖了基础知识。

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

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