Node.js Flashcards
What is a CLI?
Command-line interfaces
Processes commands to a computer program in the form of lines of text
What is a GUI?
Graphical user interface
Allows users to interact with electronic devices through graphical icons and audio indicators
Give at least one use case for each of the commands listed in this exercise.
man - To look up command information
cat - Print contents of files to see what they are
ls - See a list of the contents in a directory
pwd - To see the current working directory
echo - Kind of like console.logging. To see the status of something?
touch - To set the access date or modify a date of a file/directory
- *To create files
mkdir - To create directories
mv - To rename a file or directory
- To move a file/directory, because renaming something technically changes location
rm - To delete a file/directory
cp - To copy something, kind of like “save as” in programs
What are the three virtues of a great programmer?
Laziness, impatience, hubris
What is Node.js?
A program that allows JavaScript to be run outside of a web browser.
Commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What can Node.js be used for?
Build scalable network applications
Single-threaded event loop model
What is a REPL?
Read-eval-print loop or language shell
Simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user; a program written in a REPL environment is executed piecewise.
(browser console)
When was Node.js created?
2009, by Ryan Dahl
What back end languages have you heard of?
Python, Elixir, ruby, PHP, SQL, Java, C++, Go, C#, JavaScript, VBA, Clojure, C, Julia, Haskell, Pascal, Rust, Lisp, Perl, TypeScript, Objective-C, Swift, Kotlin, Scala
*PHP, Ruby, Python, JavaScript, Perl - very similar, just know for the job interviews or something. “What is the diff between javascript vs java
Javascript is the only one with event loop
What is a computer process?
The instance of a computer program that is being executed by one or many threads
It contains the program code and its activity.
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
Like 100 or more
Why should a full stack Web developer know that computer processes exist?
Because FSWB is based on making multiple processes work together to form one application, so having at least a cursory awareness of computer processes is necessary.
This will be extremely important when learning about applications made of multiple components, such as clients, servers, and databases.
What is the process object in a Node.js program?
A global that provides information about, and control over, the current Node.js process. As a global, it is always available to Node.js applications without using require(). It can also be explicitly accessed using require().
How do you access the process object in a Node.js program?
console. log(?)
* can just pull it out of thin air
What is the data type of process.argv in Node.js?
It returns an array containing the command-line arguments passed when the Node.js process was launched.
*Array of strings