About node.js input stream process.stdin

The

code is as follows:
remarks stdin = process.stdin;

clipboard.png

question:
stdin.on ("data",.)
this function will be triggered several times every time I enter it.

Mar.14,2021

see that you have written return in a function. I guess you must have called this function
every time you typed. Then you will register
so once and you will trigger

if you type in several times.
Menu