How do you take user inputs in Javascript(NodeJs)?

There are 2 common methods to take inputs from users in javscript(NodeJs):