The node command is what will be available in the command line of an operating system after installing nodejs if it is not part of the os image to begin with. The process of installing nodejs is outside the scope of this post, at this time I assume that you have nodejs installed, and now want to know the basics of using nodejs in the bash terminal which is typical of posix systems such as linux, or command prompt in windows systems.
So this is actually the default behavior if no argument of nay kind is given but the i option can be given as a way to make it explicit. In addition in some situations the i option must be given.
I will not be getting into the nature of the standard input and piping in this post, but of course that is another way to push input into the console in interactive mode.
Once I have a basic script worked out I can start it with the node command by just simply calling the command and passing the path to the file as an argument like this:
Simple enough right, but there is much more to it than this, lets look at some more examples when it comes to using the node command to run a script.