Open In App

Node.js process.stdout Property

The process.stdout property is an inbuilt application programming interface of the process module which is used to send data out of our program. A Writable Stream to stdout. It implements a write() method. 

Syntax:



process.stdout.write()

Return Value: This property continuously prints the information as the data being retrieved and doesn’t add a new line.

Parameters: This property takes only single strings as an argument.



  
 

Note:

 

Below examples illustrate the use of process.stdout property in Node.js:

 

Example 1: Create a JavaScript file and name this file as index.js.

 




// Node.js program to demonstrate the
// process.stdout Property
 
// Printing process.stdout property value
process.stdout.write('Greetings of the day');

Run the index.js file using the following command:

node index.js

Output:

Greetings of the day

Example 2: Create a JavaScript file and name this file as index.js.




// Node.js program to demonstrate the
// process.stdout Property
 
// For process.std.out 
// Association is not possible
process.stdout.write("Geeks");
process.stdout.write("for");
process.stdout.write("Geeks");

Run the index.js file using the following command:

node index.js

Output:

GeeksforGeeks
Article Tags :