This tutorial is in progress ...
This tutorial has exercises from www.johnsmilga.com
-
Introduction
-
Global variables
-
Modules (every nodejs file is a module by default)
Modules basics
- a) Importing a module in a file and assigning it to a const variable
- b) Importing a module in a file and assigning it to a const function
- c) Importing a module in a file and assigning it to a generic object variable which holds everything
- d) Importing a module (having a function invoked inside of it) doesn't need to be assigned to a variable as it will run by default
-
In a module we decide which variables to export & which ones to keep secret
-
Exporting a function from a module
-
Exporting arrays and objects from a module
-
Not explicitly exporting anything yet somehow when it's imported (using require function) the invoked function (present inside the exported module) runs by default.
-
os built-in module
-
path built-in module
-
fs built-in module (synchronous) ; default- contents of file is overwritten after it's run again
-
...