摘要: 1 var http = require('http'); 2 var fs = require('fs'); 3 4 var req = http.get({ host: "www.baidu.com" }); 5 6 fs.open('baidu.html', 'w', function (err, fd) { 7 if (err) { 8 console.error(err); 9 return;10 }11 var buffer;12 req.on('response', functio 阅读全文
posted @ 2013-05-07 23:11 daoyuly 阅读(353) 评论(0) 推荐(0) 编辑
摘要: Node.js Manual & DocumentationTable Of ContentsSynopsis 概要Global Objects 全局对象globalprocessrequire()require.resolve()require.paths__filename__dirnamemoduleTimers 定时器setTimeout(callback, delay, [arg], [...])clearTimeout(timeoutId)setInterval(callback, delay, [arg], [...])clearInterval(intervalId)M 阅读全文
posted @ 2013-05-07 22:51 daoyuly 阅读(2094) 评论(0) 推荐(0) 编辑