Node.js Tutorial menu

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
TopicLesson
BasicsIntroduction, Get Started
Code organisationModules, npm
Async codeAsynchronous Programming
Core modulesFile System, Events, HTTP Server
FrameworkExpress

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.

Learn Node.js with a teacher

Join the Full Stack Development course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp