Running Programs in the Terminal
Quickly navigating through our filesystems is just one benefit of using the terminal for programmers. We can also quickly run our code inside of the terminal to see the outputs.
The commands used to run a program in the terminal vary widely based on type of program you want to run. However, no matter what language you are coding in, the documentation will include, in some format, ways to run the program in the terminal.
So far, in this class, we have been running our programs by typing node <file-name>
into our terminal.
Let’s say there is an error in our program like an infinite loop. How then do we get it to stop running so we can go back and fix our code?
In many cases, typing ctrl+c into the terminal will stop a process that is currently running. However, if that doesn’t work, the exit
command can also stop a currently running process.
CLI Specific Programs and Tools
npm CLI
There is existing documentation on the npm CLI that you can view here: npm CLI
There are also many other programs and software designed to run within the terminal or cli specifically. Below is a fun example.
Neofetch is a CLI tool designed to display information about your system. It provides a logo of your operating system in addition to other hardware specifications.