Node is a program (usually run from the command line) which executes JavaScript, and comes with a built-in library for writing network and filesystem code. Node is built on V8, the same JavaScript VM used in the Chrome browser. Instead of being wrapped with a GUI and web browser features like the DOM, node wraps V8 to expose lower-level operating system APIs. Some modules that come with node include: http
, fs
(filesystem), crypto
(cryptography), and lots more.
Modules are chunks of code you can 'require' and then use. Today we'll use the http
module, like so:
var http = require('http')