Node.js - Mosh Flashcards
A runtime enviroment for executing Javascript code
Node.js
What do we use node.js for?
To build back-end services (APIs)
Who uses Back-end services?
Web Apps and Mobile Apps
In what year was Node.js Created?
2009
fs.readFIle ( ), http.createServer ( )
What are fs and http?
Objects of the node enviroment
What does it mean Blocking - Synchronus?
A single thread is assigned per client.
Node is non-blocking / Asynchronus by default?
True
What is the output of this code?
var message = "Hey"; console.log ( global.message );
undefined
The variables in the app.js are accesible in the global scope. True or false
false
What is considered a module?
A js file. Ex: app.js
How can I use a code outside of a module?
I need to export it.
What is the output of this code? <br></br>
console.log ( module );
it displays a json file
What does this code do? <br> function log ( ) { code } module.export.log = log
Exports the function log
What is the function we use in node to load a module?
require ( )
What is the Module Wrapper Function?
It’s a IIFE used to config the module.