process.stdin in Node.js?process.stdin is a readable stream that lets your Node.js program receive input from the user through the terminal or command line.
process.stdout do in Node.js?process.stdout is a writable stream that allows your program to send output to the terminal or command line, showing messages or results to the user.
process.stdin?You attach a listener to the data event on process.stdin. This event fires whenever the user types something and presses enter.
process.stdin.on('data', (input) => { console.log(`You typed: ${input}`); });process.stdout?You use the write() method on process.stdout to send text to the terminal without adding a new line automatically.
process.stdout.write('Hello, user!');process.stdin.setEncoding('utf8')?This sets the input encoding so that the data you receive from process.stdin is a readable string instead of raw bytes, making it easier to work with text input.
process.stdin in Node.js?process.stdin is a readable stream because it reads input from the user.
process.stdout?write() sends data to the terminal through process.stdout.
You listen to the data event on process.stdin to get user input.
process.stdin.setEncoding('utf8') do?It sets the input encoding so data is received as a string, not raw bytes.
process.stdout.write()?write() outputs text but does not add a new line automatically.
process.stdin and process.stdout work together in a Node.js program.