node.js Flashcards
CLI
command line interface
GUI
graphical user interface
man
manual command
ls pwd
list and present working directory
echo
print a string to the terminal or create it in txt document
touch
update or create file
mkdir
make directories
mv
rename directory or move it
rm
remove instantly. use with caution
cp
copy files
what is Node.js
JavaScript environment where you can execute JS
asynchronous event driven JS runtime
What can Node.js be used for
build scalable network applications
REPL
read eval print loop
process object in node
a global object that provides information about and control over the current node.js process
how do you access the process object?
console.log(process)
what is the data type of process.argv?
Array of strings
What is a JS module?
a single JS file
What values are passed into a Node.js modules local scope? and are they global?
module, exports, require, __filename and __dirname and NO!
what is the purpose of module.exports in a Node.js module?
to make the functionality of a certain module available to other modules.
How do you import functionality into a Node.js module from another module?
require(); passing the relative path to the other module
What is a directory?
A file containing other files.
What is a relative path?
the location of a file relative to somewhere.
What is an absolute file path?
The exact location of a file according to the root directory.
What module does Node.js include for manipulating the file system?
fs module
What method is available in the Node.js fs module for writing data to a file?
writeFile();
Are file operations using the fs module synchronous or asynchronous?
both.