I’m just starting Node today myself, so I don’t quite understand your question, but maybe these are helpful:
process.stdin:
https://nodejs.org/api/process.html#process_process_stdin , and
https://en.wikipedia.org/wiki/Standard_streams
If you don’t have https://nodejs.org/api/ bookmarked, that’s a good idea. And personally I’m (as in like half an hour ago) finding this video series helpful: https://www.youtube.com/playlist?list=PL4cUxeGkcC9gcy9lrvMJ75z9maRw4byYp