Ways to output text in node scripts

Snippet

Different ways to output text in node scripts.

Of note, console.log() calls process.stdout.write with formatted output.

process.stdout.write("look mom, no trailing newline");
 
console.log("this will have a newline at the end");

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.