What is Node.js?
- A program or set of libraries that allows JavaScript to be run outside of a web browser
What can Node.js be used for?
What is a REPL?
- It is reads single user inputs, executes/evaluates them, and returns/prints the result to the user
When was Node.js created?
2009
What back end languages have you heard of?
What is a computer process?
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
hundreds
Why should a full stack Web developer know that computer processes exist?
runtime
- language environment, how your program is executed by node.js
What is the process object in a Node.js program?
The process object is 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().
How do you access the process object in a Node.js program?
global process
What is the data type of process.argv in Node.js?
An array
process.argv (property)
What are real world applications for using process.argv?
command line processes use own process.argv
modular programming
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()
Give two examples of truly global variables in a Node.js program.
process
Class: Buffer
CommonJS
a project with the goal to establish conventions on the module ecosystem for JavaScript outside of the web browser. module specification is widely used today, in particular for server-side JavaScript programming with Node.js.
What is the purpose of module.exports in a Node.js module?
to store one module’s properties and methods on the module.exports to be transferred to another module
How do you import functionality into a Node.js module from another Node.js module?
require function
What is the JavaScript Event Loop?
The process in which JS monitors the stack and callback queue. If the stack is empty, it will push tasks (if any) from the task/callback queue onto the stack
What is different between “blocking” and “non-blocking” with respect to how code is executed?
blocking: code that is executed synchronously, code that blocks the call stack and prevents the browser from doing anything else until the process is finished
non-blocking: code that is executed asynchronously, still allows the browser to do its thing in between executing of this async code
What is a directory?
special type of file that holds information about more directories and files