1

The code is

console.log(process.argv[2]);

I get the following in console

node task.js ABC
'ABC'
<empty line>

Or without parameters (code is commented)

node task.js
<empty line>

How can i remove it?

EDIT: changed console.out to console.log

  • What is `console.out`? You are more than likely seeing that line because the function `console.out` returns *undefined* and the console will always output the return of whatever you typed in. – mwilson Mar 05 '20 at 16:26
  • Whoops, i meant `console.log` – Nodedoesntwork Mar 05 '20 at 16:29
  • https://stackoverflow.com/questions/10585683/how-do-you-edit-existing-text-and-move-the-cursor-around-in-the-terminal Or if you need 1 line up process.stdout.write('\033[1A'); – Nodedoesntwork Mar 05 '20 at 18:48

2 Answers2

0

You may try this: process.stdout.write("test") It will display your output directly to stdout, so It will not return empty line.

LPOPYui
  • 799
  • 1
  • 9
  • 17
0

How do you edit existing text (and move the cursor around) in the terminal?

Or if you need 1 line up

process.stdout.write('\033[1A');