Node.js Flashcards
What is Node.js?
- An asynchronous JavaScript runtime
- A program or set of libraries that allows JavaScript to be run outside of a web browser
What can Node.js be used for?
- Commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform
- It is primarily focused on creating simple, easy-to-build network clients and servers.
- Can write client application and server applications in Node
What is a REPL?
- Stands for “Read-Eval-Print-Loop”
- 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?
- Python
- Ruby on Rails
- Java
- PHP
- C++
- C#
- SQL
- Perl
- Go
What is a computer process?
- The instance of a computer program that is being executed by one or many threads.
- It contains the program code and its activity.
- It is the actual execution of the computer program instructions.
- takes the program and runs it, starts asking for RAM
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?
- 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
- NEED to know HTTP
- client process sends http request to
runtime
- when the program is executed
- 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)
- Returns an array containing the command line arguments passed when the Node.js process was launched.
- First element: process.execPath. (See process.argv0 if access to the original value of argv[0] is needed. )
- Second element: the path to the JavaScript file being executed.
- The remaining elements will be any additional command line arguments.
What are real world applications for using process.argv?
command line processes use own process.argv
modular programming
- breaking up into chunks and having smaller pieces of functionality
- a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.