Node Flashcards
What is Node.js?
a program that allows JavaScript to be run outside of a web browser. Node.js is powered by V8; the same JavaScript engine in the Google Chrome browser. It is free, open-source software and its source code is available on GitHub.
What can Node.js be used for?
It is commonly used to build scalable back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
A read–eval–print loop (REPL), also termed an interactive toplevel or language shell, is a 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
When was Node.js created?
May 27, 2009
What back end languages have you heard of?
Node.js, PHP, Ruby, Python, Java
What is a computer process?
the instance of a computer program that is being executed by one or many threads.
Why should a full stack Web developer know that computer processes exist?
Full stack Web development 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.
How do you access the process object in a Node.js program?
You can access it directly as it is a global object which means it is available to all Node.js applications
What is the data type of process.argv in Node.js?
object
What is a JavaScript module?
A single .js file
What values are passed into a Node.js module’s local scope?
\_\_dirname \_\_filename exports module require(id)
Give two examples of truly global variables in a Node.js program.
AbortSignal
clearImmediate(immediateObject)
What is the purpose of module.exports in a Node.js module?
To allow a module to export functions or variables in which another module can import it through require() in Node.js
How do you import functionality into a Node.js module from another Node.js module?
You export the functionality you need by assigning the value of the functionality to the export object. You then import the functionality by assigning the return of the require function to a local variable in your destination module.
What is the JavaScript Event Loop?
one of the four major concepts that sets JavaScript apart from many other languages. The order is a callback function is added to the stack but is then popped off and sent to the web API. It is then sent to the event queue when it will wait to be called. Once the call stack is empty, the first item in the event queue is pushed to the stack and execute.
What is different between “blocking” and “non-blocking” with respect to how code is executed?
Blocking is when the code has to wait on a function to execute fully first before the rest of the code can run. Non-blocking is when the the function is sent to another thread so the code can continue running without waiting
What is a directory?
AKA folders. It allow the user to group files into separate collections
What is a relative file path?
The path to a specific file relative to the current directory
What is an absolute file path?
The path to a specific file from the root directory