Node.js Flashcards
What is a CLI?
command line interface
What is a GUI?
graphical user interface
Give at least one use case for each of the commands listed in this exercise.man
manual -> look up manual for specific commands
Give at least one use case for each of the commands listed in this exercise.cat
Print standard output of a file or concatenate content of files and print out
Give at least one use case for each of the commands listed in this exercise.ls
List out current files and directory within the current directory
Give at least one use case for each of the commands listed in this exercise.pwd
Print working directory
Give at least one use case for each of the commands listed in this exercise.echo
display line of text
Give at least one use case for each of the commands listed in this exercise.touch
make file timestamp
Give at least one use case for each of the commands listed in this exercise.mkdir
Create new directory
Give at least one use case for each of the commands listed in this exercise.mv
Move or rename a file or directory
mv old_name new_name
Give at least one use case for each of the commands listed in this exercise.rm
Remove (delete) a file or directory (-r)
Give at least one use case for each of the commands listed in this exercise.cp
Make copy of file or directory (-r)
What is Node.js?
JavaScript runtime environment
What can Node.js be used for?
to built back end
automated scripts
command line programs
What is a REPL?
read-eval-print loop
What is the process object in a Node.js program?
an 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?
const variableName = require(“node:process”);
What is the data type of process.argv in Node.js?
Array of string
What is a JavaScript module?
file that contain related codes
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.
process, console
What is the purpose of module.exports in a Node.js module?
to give access to the variable to be used on another file/module
How do you import functionality into a Node.js module from another Node.js module?
const variableName = require(‘pathOfFileToImport’);
What is the JavaScript Event Loop?
part of a runtime environment => Look at the call stack, if stack is empty, push (asynchronous callback) task from task queue onto call stack operation