what is node js
npm install http then write a webserver...
const http = require('http');
const PORT = 3000;
const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World');
});
server.listen(port, () => {
console.log(`Server running at PORT:${port}/`);
});
Javascript generally runs on Browser(Client).
An Example Browser - Chrome, has v8 Engine, which compiles Javascript to a code the computer can understand.
Thus Node.js can run Javascript on Server with Chrome's V8 Engine.
Further Reading: https://www.freecodecamp.org/news/what-exactly-is-node-js-ae36e97449f5/