node 命令

node a.js  执行文件

-v 版本

-e == eval 解析js代码 eval('alert("ok")')

node 编译模式

返回结果:第一行是输出,第二行是返回值


var http = require('http');
http.createServer(function(req,res){
	res.writeHead(200,'text/plain');
	res.write('first demo');
	res.end('hello world');
}).listen(3000);

  


异步I/O,事件驱动

exports.sayHello();

原文地址:https://www.cnblogs.com/guduey/p/4463253.html