Sunday, February 13, 2011

NodeJS- Useful Modules

1. express (RESTful routing, )

High performance, high class web development for Node.js

 var express = require('express');
var app = express.createServer();
app.get('/', function(req, res){
res.send('Hello World');

  • Robust routing
  • Redirection helpers
  • Dynamic view helpers
  • Application level view options
  • Content negotiation
  • Focus on high performance
  • View rendering and partials support
  • Environment based configuration
  • Session based flash notifications
  • Built on Connect
  • Executable for generating applications quickly
  • High test coverage

2. (Websocket)

3. couch_client (CouchDB)

4. node_redis (redis)

5. mDNS/Zeroconf/Bonjour (
Hmm unfortunately this is not useable in my Appliance, so I gave up to use this even though I need this feature.

 npm install mdns 

Service Discovery

node_mdns – service discovery for node.js
node_mdns adds support for multicast DNS service discovery, also known as zeroconf or bonjour to node.js. It provides an object-oriented interface to announce and browse services on the local network.

Internally, it uses the mDNSResponder API which is available on all major platforms.

On Linux and other systems using the avahi daemon the avahi dns_sd compat library and its header files are required.

 var mdns = require('mdns'); 
// Browser.
var browser = mdns.createBrowser('http');
browser.on('serviceUp', function(info, flags) {
browser.on('serviceDown', function(info, flags) {
browser.on('serviceChanged', function(info, flags) {
// Advertisement.
// mdns.createAdvertisement('http', 4321).start();

6. msgpack (gave up because it is hard to compile in my centos/mac)
A space-efficient object serialization library for NodeJS

No comments: