Index
Video
A video that accompanies this page is here...
Purpose
Modules are one of the key parts of Node.js.
Think of a module as a JavaScript file that is reusable, including functions, classes and/or data.
Guide Examples
These sources will guide you. Simply post to the course discussion board if you don't see the guidance you need.
You will also find "Node.js modules" as common fodder on the internet.
Problem Statement
Development
- Create a project directory named "modules"
- Code a file named "module1.js" that exports one class (you may want to use one of your classes from previous challenges -- or create new -- coder's choice)
- Code a file named "module2.js" that exports one or more functions
- Code a file named "module-user.js" that imports your two created modules, and it uses the exported class and functions to print some values (coder's choice) to the console
Initializing this project using npm is optional (but is always good practice).
Running Program
Your final program should be usable as follows:
- Start (run) your program (module-user.js)
- Results should display in the console.
Submit
Code submission/delivery is two step:
- Delete project "node_modules" directory (if present). Here is why...
- Copy project root directory into archive to submit (please do not nest archives)
- Use ".zip" format for archive
Introduction To Node.js
Module Drill