Node.js TutorialLesson 5Free preview
Node.js vs Browser
This lesson is part of Node.js · All levels
Summary
Node.js and the browser both run JavaScript, but the environment is very different. The browser provides users with DOM, window, and event, while the Node provides access to file system, low-level network, and process object. Built-in APIs such as fetch are now available in both, but most other APIs are exclusive.
Key points
- The browser provides the user's DOM, window, and event; the Node provides fs, net, and process
- Node can read/write files and open a server port, browser can't
- Some APIs are already the same in both, like fetch, promise, and web crypto.
- The node doesn't have an alert or document, so the browser code needs to be customized.
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.