Node.js 教程
通过示例学习
我们的“显示 Node.js”工具使学习 Node.js 变得容易,它同时显示代码和结果。
示例
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
}).listen(8080);
运行示例 »
点击“运行示例”按钮查看其工作原理。
在命令行界面中运行的示例
在本教程中,有一些示例通过在命令行界面中显示结果来更好地解释。
当这种情况发生时,“显示 Node.js”工具将在右侧的黑色屏幕中显示结果
示例
console.log('This example is different!');
console.log('The result is displayed in the Command Line Interface');
运行示例 »
点击“运行示例”按钮查看其工作原理。
我的学习
在 W3Schools 使用免费的“我的学习”计划来跟踪你的进度。
登录你的账户,开始赚取积分!
这是一个可选功能。你可以在 W3Schools 学习,而无需使用“我的学习”。

Node.js 参考
Node.js 包含一组内置模块。
下载 Node.js
从官方 Node.js 网站下载 Node.js:https://node.org.cn