NodeJs
Node.js
Introduction to Node.js
- NodeJS is not a language
- It is a runtime environment that allows you to run JavaScript code outside the browser
- It build using Chrome v8 engine(v8 wriiten in C++ ) +
Libuvand v8 engine is responsible for converting JavaScript normal code into machine code that will understand by computer. - NodeJS is a single thread
Normally JavaScript runs only inside the browser like Chrome or Firefox But NodeJS allows JavaScript to run directly on your computer server or backend
Main parts inside NodeJS
- V8 Engine – runs JavaScript code
- Libuv – handles asynchronous tasks like file system network etc
- Event Loop – keeps checking for finished tasks and runs their callbacks
- Callback Queue – stores callbacks waiting to be run
- Thread Pool – background workers that do slow tasks