Node.js

Node.js is a JavaScript runtime environment that processes incoming requests in a loop, called the event loop.

Node.js functions are non-blocking: commands execute concurrently or even in parallel, and use callbacks to signal completion or failure.

Installation on Kali

sudo apt install nodejs

Help

nodejs and node commands are the same. /usr/bin/nodejs -> node

node
.help

Hello World

hello.js

var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World!');
}).listen(8081);
node hello.js

Access at http://127.0.0.1:8081