Node.js Flashcards
What is Node.js?
an asynchronous event-driven JavaScript runtime
What can Node.js be used for?
run JavaScript outside of a web browser to build applications.
What is a REPL?
read-eval-print loop
a computer programming environment that takes user inputs, executes them, and returns the result.
When was Node.js created?
Initial release was May 2009
What back-end languages have you heard of?
Scripting Language (often interpreted) JavaScript Ruby Python PHP Perl
Compiled Language C# Java Go Haskell typescript
Questions I have:
What is a runtime?
- all of the stuff that surrounds your program that you didn’t write
What is a thread?
- what the cpu uses as a spot to pick up where it left off in running a program
What is dead-locking?
- when two threads are relying on each other to finish in order to execute the next step
What is a computer process?
a process is the instance of a running computer program.
While a computer program is a passive collection of instructions typically stored in a file on disk, a process is the execution of those instructions after being loaded from the disk into memory.
Roughly how many computer processes are running on your host operating system? (activity monitor)
628 processes
com.docker.hyperkit is using the most CPU
What is the “process” object in a Node.js program?
the process object is a global object that can be accessed inside any module without requiring it.
How do you access the “process” object in a Node.js program?
Since it is global you can just use its name like a variable that has already been defined
What is the data type of process.argv in Node.js?
array of strings
What is the 3 tierd structure of full stack web development?
Front end process
Back end process
Data process (at least one)
What is a JavaScript Module?
it is a single .js file.
Authors of Node.js programs strive to separate their code into modules that each provide a small chunk of functionality.
The program as a whole is the result of all these modules working together in concert.
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
global
What is the idea behind modular programming?
decompose a solution to a large problem into many smaller solutions to sub-problems
What is the purpose of module.exports in a Node.js module?
to tell which bits of code to export from a given file so other files are allowed to access the exported code.