Node.js Flashcards
what is Node.js?
Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser. (that comes with libraries)
What can Node.js be used for?
Node.js is primarily used for non-blocking, event-driven servers, due to its single-threaded nature. It’s used for traditional web sites and back end API services, but was designed with real-time, push-based architectures in mind.
what is REPL?
A read–eval–print loop, 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.
waits for another input.. ex) browser console
when was Node.js created?
May 27, 2009
What back end languages have you heard of?
Python, C++, Java, PHP, Ruby on rails, Go etc
scripting language (often interpretted) compile language
what is a computer process?
a process is the instance of a computer program that is being executed by one or many threads.
It contains the program code and its activity.
Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.
answer : it is the instance of a running program
Roughly how many computer processes are running on your host operating system (Task Manager or Activity Monitor)?
14? the rest of em are sleeping
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?
The process object in Node. js 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?
its global so you don’t need the require method. just access itself.
What is the data type of process.argv in Node.js?
array
What is a JavaScript module?
A module in JavaScript is just a file containing related code.
In JavaScript, we use the import and export keywords to share and receive functionalities respectively across different modules. The export keyword is used to make a variable, function, class or object accessible to other modules
What values are passed into a Node.js module’s local scope?
exports, require, module, __filename, and __dirname
Give two examples of truly global variables in a Node.js program.
global and process
(similar to window, can control the process. the difference is, if you create the global object is the property of the window object)
What is the purpose of module.exports in a Node.js module?
Module exports are the instruction that tells Node.js which bits of code (functions, objects, strings etc) to “export” from a given file so other files are allowed to access the exported code.