Node.js Flashcards
what is Node.js?
a cross-platform JavaScript runtime environment that allows developers to build server-side and network applications with JavaScript
Node.js is a way to execute JS outside of the browser environment
what can Node.js be used for?
primarily used for non-blocking, event-driven servers, but was designed with real-time, push-based architectures in mind
what is a REPL?
Read-Eval-Print-Loop (REPL)
REPL is a simple interactive computer programming environment that takes single user inputs, executes them, and returns the result to the user
when was Node.js created?
2009 by Ryan Dahl
What back end languages have you heard of?
Ruby (scripting) Php (scripting) Java (compiled) c## (compiled) Python (scripting) C (compiled) C++ (compiled) Swift (compiled/scripting) Objective-c (compiled) Javascript (script) Perl (scripting) Go (compiled) scripting/interpreted language is parsed and then some predefined functionality is executed (by a program called an interpreter) Compiled language is written one way, but then converted into something that a machine can already understand (by a program called a compiler)
** command-line basics **
what is a CLI?
command-line interface
process commands to a computer program in the form of lines of text
** command-line basics **
what is a GUI?
graphical user interface
a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigations
** command-line basics **
give at least one use case for each of the commands listed
man - reference to the online reference manuals
cat - concatenate files and print on the standard output
ls - list directory contents
pwd - print name of current/working directory
echo - display a line of text
touch - change file timestamps
mkdir - make directories
mv - move (rename) files
rm - remove files or directories
cp - copy files and directories
what are the three virtues of a great programmer?
Laziness: the quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don’t have to answer so many questions about it
Impatience: the anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to.
Hubris: the quality that makes you write (and maintain) programs that other people won’t want to say bad things about
what is a computer process?
the instance of a computer program that is being executed by one or many threads
roughly how many computer processes are running on your host operating system (task manager or activity monitor)?
100+
why should a full stack developer know that computer processes exist?
computer processes can help with learning about applications made of multiple components
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
how do you access the process object in a Node.js program?
process.argv
what is the data type of process.argv in Node.js
Object
what is a JavaScript module?
a separate JS file with its own code that will be part of a main JS file
what values are passed into a Node.js module’s local scope?
ID, exports, parent, filename, loaded, children, paths
give two examples of truly global variables in a Node.js program
clearImmediateFunction, console object