Index
Overview
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 file system" as common fodder on the internet.
Problem Statement
Development
- Create a project directory named "files"
- Code a file named "read-file.js" that reads a file and prints the contents to the console (you will need to create a text file to read)
- Code a file named "write-file.js" that creates a file and writes content to it (content is coder's choice)
- Files read and written should be in project directory or project sub-directory
Initializing this project using npm is optional (but is always good practice).
Running Read Program
Your final program should be usable as follows:
- Start (run) your program (read-file.js)
- File contents should display in the console.
Running Write Program
Your final program should be usable as follows:
- Start (run) your program (write-file.js)
- File with custom contents should be created
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
File System Drill