How to take command line user input in Node.js?

Please tell how to take user input in javascript/Nodejs ?
I want to do competitive coding with Node js?

Can you check this once:-

Let me know which website you are planning to use for competitive programming in case this does not help.

If I want to practice in local computer then how to take user input from command line.
Like taking input of an array elements.

I have not used node.js to take user inputs before but you can check this link for reference:-

I think this is a simpler option

npm install prompt-sync
const prompt = require("prompt-sync")({ sigint: true });
//With readline
const name = prompt("What is your name?");
console.log(`Hey there ${name}`);`enter code here`