node.js中的process.nextTick()和setImmediate()

process.nextTick()和setImmediate()在node.js中都是将回调函数延时执行。跟setTimeout(function(){}, 0);类似,但性能不一样,setTimeout定时器是采用红黑树,process.nextTick()是用数组,setImmediate(...

2015-07-23 15:41:14

阅读数:720

评论数:0

MAC上安装node-canvas

安装Node.js的canvas库时发现canvas依赖cairo包: $ npm install canvas ... > node-gyp rebuild ... No package 'cairo' found 可以通过brew安装,但是安装时发现cairo依赖于X11...

2015-07-08 21:49:43

阅读数:989

评论数:0

MAC下安装node.js

一、安装Homebrew http://brew.sh ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 可能用到的brew命令 brew l...

2015-07-08 21:37:11

阅读数:277

评论数:0

提示
确定要删除当前文章?
取消 删除
关闭
关闭