以下は、Node.JS のほとんどの書籍に記載されている典型的な hello world の例です。
var http = require('http');
http.createServer(function (req, res) {
res.**writeHead**(200, {'Content-Type': 'text/plain'});
res.**end**('Hello World\n');
}).listen(8124, "127.0.0.1");
「require」を介してhtml機能がvar httpに入れられたことを理解できます。したがって、.createserver 関数はそのモジュールに記述され、コールバックのパラメーターとして無名関数が渡されます。しかし、「writehead」と「end」はどこで定義されていますか? それは正確には何ですか?