nodejs一周动态(2011-04-25 - 05-01)
发布于 11 年前 作者 fengmk2 5113 次浏览 最后一次编辑是 6 年前

本文收集一周来业界关于nodejs的相关动态信息和新闻摘要,并会推荐一下非常棒的node.js模块。 <br/><h2><a href=“”>Mozilla jumps into Node.js server project</a></h2> <br/>Mozilla也对Node.js感兴趣了,已经着手为Node.js提供V8以外的另一个引擎: <br/><a href=“”>SpiderNode</a>: This JavaScript engine in Firefox is called SpiderMonkey, and the hybrid technology used in SpiderNode is called V8Monkey <br/> <br/>Node.js is built with the V8 JavaScript engine from Google’s Chrome browser, but Mozilla is transplanting Firefox’s JavaScript technology in a project called SpiderNode. (The JavaScript engine in Firefox is called SpiderMonkey, and the hybrid technology used in SpiderNode is called V8Monkey.) <br/><h2><a href=“”>Build Desktop Apps with Node.js Using WebApp</a></h2> <br/>Node.js contributor Tim Caswell pushed an initial release of WebApp, a framework for building desktop GUI apps with Node.js, to GitHub. The stated goal is to “Give node developers a way to have a desktop GUI to their node servers using HTML5 + CSS3 as the GUI platform.” <br/>Node.js也可以开发桌面程序! <br/><h2><a href=“”>Node v0.4.7 release</a></h2> <br/><ul> <br/> <li>Don’t emit error on ECONNRESET from read() #670</li> <br/> <li>Fix: Multiple pipes to the same stream were broken #929 (Felix Geisendörfer)</li> <br/> <li>URL parsing/formatting corrections #954 (isaacs)</li> <br/> <li>make it possible to do repl.start(’’, stream) (Wade Simmons)</li> <br/> <li>Add os.loadavg for SunOS (Robert Mustacchi)</li> <br/> <li>Fix timeouts with floating point numbers #897</li> <br/> <li>Improve docs.</li> <br/></ul> <br/>Download: <a href=“”></a> <br/>Website: <a href=“”></a> <br/>Documentation: <a href=“”></a> <br/><h2>Cluster Live</h2> <br/>TJ Holowaychuk released <a href=“”>Cluster Live</a> (GitHub: <a href=“”>visionmedia / cluster-live</a>, MIT License), which is a realtime administration and statistics plugin for Cluster. If you’ve been holding off on Cluster, this is probably the sort of usage TJ envisioned for it and may convince you to use it. <br/> <br/>你只需要一点点配置代码,就可以使用了,很cool吧!: <br/><pre escaped=“true”>var live = require(‘cluster-live’); <br/> <br/>cluster(server) <br/>  .set(‘workers’, 6) <br/>  .use(cluster.debug()) <br/>  .use(cluster.stats({ connections: true, lightRequests: true })) <br/>  .use(live()) <br/>  .listen(3000); <br/></pre> <br/>截图 <br/> <br/><img src=“” alt="" width=“90%” height=“300” /> <br/><h2>Capsule</h2> <br/><a href=“”>Capsule</a> (MIT License) by Henrik Joreteg is a Node framework that uses and Backbone.js to synchronise models between the client and server. He’s written some documentation for <a href=“”>Capsule.models.js</a> and <a href=“”>Capsule.views.js</a>, and the README includes a detailed example of how to set things up for the server and browser. <br/><h2><a href=“”>node-http-proxy</a></h2> <br/><a href=“”>node-http-proxy</a>: <br/>一个基于nodejs全功能http代理 <br/>A full-featured http proxy for node.js <br/><h3>Features</h3> <br/><ul> <br/> <li>Reverse proxies incoming http.ServerRequest streams</li> <br/> <li>Can be used as a CommonJS module in node.js</li> <br/> <li>Uses event buffering to support application latency in proxied requests</li> <br/> <li>Reverse or Forward Proxy based on simple JSON-based configuration</li> <br/> <li>Supports WebSockets</li> <br/> <li>Supports HTTPS</li> <br/> <li>Minimal request overhead and latency</li> <br/> <li>Full suite of functional tests</li> <br/> <li>Battled-hardened through production usage @</li> <br/> <li>Written entirely in Javascript</li> <br/> <li>Easy to use API</li> <br/></ul> <br/><h3>When to use node-http-proxy</h3> <br/>Let’s suppose you were running multiple http application servers, but you only wanted to expose one machine to the internet. You could setup node-http-proxy on that one machine and then reverse-proxy the incoming http requests to locally running services which were not exposed to the outside network. <br/><h2>npm 1.0: Released</h2> <br/><a href=“”>npm 1.0 has been released</a>. Here are the highlights: <br/><ul> <br/> <li>Global vs local installation</li> <br/> <li>ls displays a tree, instead of being a remote search</li> <br/> <li>No more “activation” concept – dependencies are nested</li> <br/> <li>Updates to link command</li> <br/> <li>Install script cleans up any 0.x cruft it finds. (That is, it removes old packages, so that they can be installed properly.)</li> <br/> <li>Simplified “search” command. One line per package, rather than one line per version.</li> <br/> <li>Renovated “completion” approach</li> <br/> <li>More help topics</li> <br/> <li>Simplified folder structure</li> <br/></ul> <br/>