How to write interactive problems using NodeJS or Rust?

Hello Competitive programmers,

I have been working with NodeJS & Rust in my career rather than C/C++. (When I was at the university, of course I did competitive programming using C/C++ but now I do it with NodeJS & Rust because it gives me more comfort)

In this case, I am not sure how to write interactive tasks using NodeJS or Rust because I get all inputs as a whole string and then divide by lines and as a result, I can’t get the input in interactive tasks.

I will be appreciated if anyone can post a sample code for an interactive problem using NodeJS or Rust

Best regards,