DevAcademy

Node.js Beginner Practice

27 questions covering 9 Node.js topics.

Quick Quiz

1. What engine is Node.js built on?

2. What is a key difference between Node.js and browser JavaScript?

3. Which of these is a common Node.js use case?

4. What does nvm let you do?

5. Which release line is recommended for production applications?

6. Does installing Node.js also install npm?

7. How many main threads does a Node.js process run JavaScript on?

8. What is libuv responsible for?

9. Why can a CPU-heavy synchronous task be a problem in Node.js?

10. What does npm install -D typescript do differently from npm install typescript?

11. What is the purpose of package-lock.json?

12. What does npm install (with no package name) do?

13. What does the scripts field in package.json define?

14. What does the caret (^) mean in a version like "^4.19.2"?

15. What shorthand exists for npm run start?

16. What is the CommonJS equivalent of ES Modules' export?

17. What does "type": "module" in package.json do?

18. Is a file extension required when importing a local file with ES Modules?

19. Why can't browser JavaScript directly read arbitrary files from disk, but Node.js can?

20. Why should readFileSync() be avoided in a running web server?

21. What does fs/promises provide?

22. Why does the path module exist instead of manually building paths with string concatenation?

23. What does path.extname("photo.jpg") return?

24. Are __dirname and __filename automatically available in ES Modules the same way as CommonJS?

25. What does os.platform() return?

26. What is a common use for os.cpus().length?

27. What does os.tmpdir() return?