JavaScript

Node.js

Node.js lets you run JavaScript on a server or your own machine instead of inside a browser. It's built on the same V8 engine Chrome uses.

Running code

Save a file and run it with node:

// hello.js
console.log("Hello from Node");

// terminal:
// node hello.js

Modules and npm

Code is split into modules. npm installs packages other people have published.

npm init -y
npm install express

A tiny server

Node ships with an http module, so you can answer web requests with no extra libraries:

const http = require("http");
http.createServer((req, res) => {
  res.end("Hello, web");
}).listen(3000);