- 博客(9)
- 资源 (4)
- 问答 (1)
- 收藏
- 关注
原创 node.js url
var url = require('url');var content = url.parse("http://www.jd.com/");console.log(content);var url = require('url');var content = url.format({ protocol: 'http:', slashes: true, auth: null,
2016-04-28 18:38:58 455
原创 node.js process
process.on('uncaughtException', function (err) { console.log('Caught exception: ' + err);});setTimeout(function () { console.log('This will still run.');}, 500);// Intentionally cause an excep
2016-04-28 16:36:44 483
原创 node.js 加载包 package.json
目录结构 lib 、bin、test 包和package.json全部放在package包下{"main":"./lib/package.js"}package.jsexports.hello = function(){ console.log("test package");}getPackage.jsvar pack = require("./
2016-04-28 11:44:24 2297
原创 node.js require 加载自己的模块
module.jsvar name ;exports.setName = function setName(full_name){ name = full_name;}exports.sayHello = function sayHello(){ console.log("Hello " + name);}getModule.jsvar module = req
2016-04-28 10:54:13 1868
原创 Node.js EventEmitter 事件监听
//event.js var EventEmitter = require('events').EventEmitter; var event = new EventEmitter(); event.on('some_event', function() { console.log('some_event occured.'); }); setTimeout(function(
2016-04-28 09:46:33 1764
原创 Node.js 读写文件
D:\NodeJs\node>npm install iconv-lite上面为了支持中文?//由于Node.js仅支持如下编码:utf8, ucs2, ascii, binary, base64, hex,并不支持中文GBK或GB2312之类的编码,//因此如果要读写GBK或GB2312格式的文件的中文内容,必须要用额外的模块:iconv-litevar
2016-04-26 17:49:58 633
原创 Node.js 基础命令
node -vC:\Users\dell\Desktop\node>node -e "console.log('hello word')";hello wordC:\Users\dell\Desktop\node>node> console.log("haha")hahaundefined>第一行执行结果,第二行返回值如果乱码,用utf-8C:\U
2016-04-26 15:21:59 3580
原创 Node.js Error: listen EADDRNOTAVAIL
C:\Users\dell\Desktop\node>node nodedemo.jsConfiugre: host=192.168.1.115, port=8080Server created: [object Object]events.js:141 throw er; // Unhandled 'error' event ^Error: listen EAD
2016-04-26 14:44:28 13855
andorid cdd 翻译
2012-02-01
struts2对继续ActionSupport个数有限制
2016-01-31
TA创建的收藏夹 TA关注的收藏夹
TA关注的人