- 博客(7)
- 资源 (4)
- 收藏
- 关注
转载 node.js 事件乒乓
var EventEmitter = require('events').EventEmitter;var pingPong = new EventEmitter();setTimeout(function(){ console.log('sending first ping'); pingPong.emit('ping');},2000);pingP
2014-02-27 18:15:05 1310
转载 Node.js Cannot find module 'xxx' 问题解决
使用npm install -g 'xxx' 之后仍然报 Cannot find module 'xxx' 错误,可以通过设置环境变量来解决; export NODE_PATH=/usr/local/lib/node_modules/ echo $NODE_PATH
2014-02-24 12:12:38 138119 6
转载 node http.get options
var http=require('http');var options = { host:'localhost', port:80, path:'/read.txt'};http.get(options, function(res) { console.log("Got response: " + res.statusCode);
2014-02-19 18:24:26 1538
转载 node 重定向
var http = require('http');http.createServer(function(req, res){ res.writeHead(301,{ 'Location':'http://baidu.com' }); res.end();}).listen(3000,'127.0.0.1');
2014-02-19 17:57:00 2990
转载 node 读文件内容
var fs = require('fs');fs.readFile('/export/home/www/testNode/read.txt', 'utf-8', function(err, data) { if(err) throw err; console.log(data);});
2014-02-19 17:31:29 765
转载 node http.get
var http=require('http');http.get("http://localhost/read.txt", function(res) { console.log("Got response: " + res.statusCode); res.on('data', function(data) { console.log("Got data: " + data)
2014-02-19 11:52:39 6703
压力测试工具ab.exe
2015-03-20
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人