DailyJS

Node Roundup: Common Node, NodeCamp.eu Talks, Hook.io

2011-06-15 00:00:00 +0100 by Alex R. Young

Common Node

Common Node (GitHub: olegp / common-node) by Oleg Podsechin
uses node-fibers to build
CommonJS proposals. This means it's now possible in many cases to write
asynchronous code with synchronous logic.

The CommonJS proposals implemented by Common
Node
are:

This fragment is from the
https.js example:

new HttpClient({url: 'http://google.com'}).finish().body

The finish() method calls
HttpClient.prototype.read which uses a fiber:

var req = protocols[uri.protocol].request(options, function(response) {
  fiber.run(response);
});

As Oleg says in his documentation:

Fibers are used to emulate multi-threading within a single process, allowing one to use a synchronous programming style and as a result.

NodeCamp.eu Talks

I saw Ryan Dahl tweeted a link to this huge list of
nodecamp.eu talk slides: A collection of talks and presentations held at nodecamp.eu
2011
.

using libuv and http-parser to build a webserver from ry on Vimeo.

The Understanding V8 talk includes
some real JavaScript examples, and Ryan Dahl's talk is available as a
screencast.

Ryan's talk is about using libuv and
http-parser to build a web server using C. It's not as scary as it sounds, libuv really looks very
accessible.

Hook.io

Hook.io by Marak Squires is a distributed EventEmitter:

You create custom i/o scenarios by picking and choosing from an extensive library of tiny, independent, autonomous "hooks" that seamlessly work together.

It has a big list of interesting features: