Input
Learn about various input methods in Node.js.
We'll cover the following
Command line input
Let’s start with the most basic form of input, the command line input. Depending on how much you have used a terminal before, you may or may not be familiar with passing input to a program using the terminal. Let’s see how we do that first.
Suppose we have a simple program called app.js
. This program prints out whatever you pass to it. You can pass it arguments by simply writing them after the program’s name in the terminal. Try it out with the command node app.js Hello
. Hit the RUN button to get started.
Get hands-on with 1400+ tech skills courses.