Node Flashcards
What is Node.js?
Node.js is a program that allows JavaScript to be run outside of a web browser.
What can Node.js be used for?
It is commonly used to build back ends for Web applications, command-line programs, or any kind of automation that developers wish to perform.
What is a REPL?
read–eval–print loop
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?
2009
What back end languages have you heard of?
JavaScript, Java, PHP, Python, Ruby, C#, SQL, C++, C, Rust,
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. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently.
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
To know what is involved for an application to run
What is the ‘process’ object in a Node.js program?
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?
It’s global, it’s there and you can always access it?
What is the data type of ‘process.argv’ in Node.js?
Array of strings
What is a JavaScript module?
A single ‘.js’ file; The important part is file.
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 and global
What is the purpose of ‘module.exports’ in a Node.js module?
Pick and choose what is available to other modules
To export functionality from one Node.js module to another Node.js module.
How do you import functionality into a Node.js module from another Node.js module?
require function
const add = require(‘./add’);