What is Node.js?
Node.js is an open-source, cross-platform JavaScript runtime environment built on Chrome's V8 JavaScript engine. It allows you to run JavaScript on the server side, outside of a browser.
Key Features
- Event-Driven: Node.js uses an event-driven, non-blocking architecture
- Asynchronous: I/O operations never block the execution thread
- Single-Threaded: Uses a single thread with event looping for high concurrency
- NPM: The largest ecosystem of open-source libraries
Node.js Architecture
// Node.js runs on the V8 engine (same as Chrome)
// libuv provides the event loop and async I/O
// Process global represents the running Node process
console.log("Node.js version:", process.version);
console.log("Platform:", process.platform);
console.log("Architecture:", process.arch);