Node.js Flashcards
(126 cards)
What is a CLI?
Command-line interface
Allows users to interact with a computer program by typing in text/commands
What is a GUI?
Graphical user interface
Allows user to interact with electronic devices through graphical icons and audio indicator
Give at least one use case for each of the commands listed in this exercise.
- man
- cat
- ls
- pwd
- echo
- touch
- mkdir
- mv
- rm
- cp
man: man is an interface to the on-line reference manuals
cat: concatenate files and print on the standard output
ls: list directory contents of current directory
pwd: print name of current/working directory
echo: display a line of text
touch: change file to time stamps
mkdir: makes directories
mv: move (rename) files
rm: remove files or directories
cp: copy files & directories
What are the three virtues of a great programmer?
- laziness
- impatience
- hubris
What is Node.js?
Program that allows JavaScript to be run outside of a web browser
What can Node.js be used for?
Used to build back ends for Web applications, command-line programs, or any kind of automation
What is a REPL?
Read-eval-print loop
A simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user
It is a loop because it waits for the input before executing again
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
Python, Ruby, Java, Node.js (JavaScript)
What is a computer process?
Instance of a running program
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
Around 600
Why should a full stack Web developer know that computer processes exist?
It is a web developers job to make multiple processes work together to form one application
What is the ‘process’ object in a Node.js program?
The process object is a global object that provides information about, and control over, the current Node.js process
How do you access the ‘process’ object in a Node.js program?
Can be accessed anywhere since it is global
What is the data type of ‘process.argv’ in Node.js?
An array
What is a JavaScript module?
A single .js file
What values are passed into a Node.js module’s local scope?
- exports
- require
- module
- __filename
- __dirname
Give two examples of truly global variables in a Node.js program.
Global
Process
What is the purpose of module.exports in a Node.js module?
It allows us to separate a large code into smaller modules that can be exported when called/needed
How do you import functionality into a Node.js module from another Node.js module?
By using require( )
What is the JavaScript Event Loop?
The event loop is a process that waits for the Call Stack to be clear before pushing callbacks from the Task Queue to the Call Stack.
What is the difference between “blocking” and “non-blocking” with respect to how code is executed?
Blocking - execute synchronously (does one task at a time)
Non-blocking - execute asynchronously (can do another task before previous one is finished)
What is a directory?
Special folder that contains other files
What is a relative file path?
Locates a file or folder on a file system starting from the current directory