DailyJS

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

Alex R. Young

Subscribe

@dailyjs

Facebook

Google+

events node modules fibers

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

Posted by Alex R. Young on .
Featured

events node modules fibers

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

Posted by Alex R. Young on .

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:

  • assert
  • binary
  • fs
  • httpclient
  • io
  • jsgi
  • system
  • test

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:

  • Create hooks on ANY device that supports JavaScript
  • Interprocess Message Publishing and Subscribing done through EventEmitter2 and dnode
  • Spawning and Daemonizing of processes handled with Forever