Node.js Quiz
Check what you have learned in this Node.js tutorial. Answer each question and read the explanation.
Before You Start
- Answer without looking at the lessons first
- When you get one wrong, open the lesson and run its example again
- Then build a small project, such as an API for a shop's products saved in a JSON file
| Topic | Lesson |
|---|---|
| Basics | Introduction, Get Started |
| Code organisation | Modules, npm |
| Async code | Asynchronous Programming |
| Core modules | File System, Events, HTTP Server |
| Framework | Express |
Quiz Questions
Exercise
Which of these is NOT available in Node.js by default?
Exercise
Why is Node.js good at handling many users at once?
Exercise
Which line imports a function from your own file in CommonJS?
Exercise
Which command adds a package as a development-only dependency?
Exercise
What do you get if you forget await before readFile from fs/promises?
Exercise
What does writeFile do if the file already exists?
Exercise
Which EventEmitter method runs a listener only the first time an event fires?
Exercise
Which HTTP status code means "Not Found"?
Exercise
In Express, how do you read the id from the URL /api/courses/7 with the route /api/courses/:id?
Great work! Next, connect your Express API to a real database and build a front end for it with React or Vue.
