Node.js: printing to console without a trailing newline?

后端 未结 8 2199
-上瘾入骨i
-上瘾入骨i 2020-11-28 00:27

Is there a method for printing to the console without a trailing newline? The console object documentation doesn\'t say anything regarding that:

8条回答
  •  离开以前
    2020-11-28 00:36

    You can use process.stdout.write():

    process.stdout.write("hello: ");
    

    See the docs for details.

提交回复
热议问题