Node.js Flashcards
[Command Line]
What is a CLI?
Command line interface - interface for commands
[Command Line]
What is GUI?
graphical user interface - applications meant for consumers (end users)
[Node intro]
What is Node.js?
A program that allows JavaScript to be run outside of a web browser used to build back ends for Web applications, command-line programs or any kind of automation that developers wish to perform.
[Node Intro]
What can Node.js be used for?
To build scalable network applications, using JavaScript in back-end
[Node Intro]
What is a REPL?
Read-Eval-Print-Loop
Reads input, evaluates, prints the output, waits for next input (loop)
[Node Intro]
When was Node.js created?
May 27, 2009
[Node Intro]
What back end languages have you heard of?
Scripting Languages (interpreted): Python, JavaScript, Ruby, PHP, Perl
Compiled Languages: C, C++, Go, haskell, crystal, rust, SQL* (databases)
Partially Compiled: Java (jvm), Scala (jvm), Clojure (jvm), Kotlin (jvm), C# (.net clr), F# (.net clr), visual basic
[Node Process Argv]
What is the process object in a Node.js program?
It gives information and control over the current node.js process.
[Node Process Argv]
How do you access the process object in a Node.js program?
use require() or
call the process variable because it’s global
[Node Process Argv]
What is the data type of process.argv in Node.js?
An array of strings containing all arguments passed when command was launched
[Node Module System]
What is a JavaScript module?
Separate JavaScript files for different specific functionalities, that can work together with other files (modules).
[Node Module System]
What values are passed into a Node.js module’s local scope?
__dirname
__filename
exports
module
require()
[Node Module System]
Give two examples of truly global variables in a Node.js program.
process
console
setInterval() /clearInterval()
setTimeOut() / clearTimeOut()
[Node Require]
What is the purpose of module.exports in a Node.js module?
So that modules can share functionalities between files.
[Node Require]
How do you import functionality into a Node.js module from another Node.js module?
require(‘relativePathURL’);
example: require(‘./filename.js’);