Node Roundup: BinaryJS, Advice, Buildify, MaDGe

2012-08-01 00:00:00 +0100 by Alex R. Young
You can send in your Node projects for review through our contact form or @dailyjs.


BinaryJS (GitHub: binaryjs / binaryjs, License: MIT, npm: binaryjs) by Eric Zhang uses WebSocket to stream binary data. The streams can be bidirectional, and is binary end-to-end. This basically gives browsers something closer to TCP sockets, and allows multimedia data to be streamed.

The client-side portion works with Chrome, Firefox, Internet Explorer 10, and Safari's nightly builds. The authors are working on supporting older browsers (presumably through Flash).

BinaryJS employs BinaryPack a modified version of the MessagePack protocol. The Node.js server uses a modified version of the ws library enhanced to pass through the status of the socket buffer so adherence to Node.js Stream API is possible.

Advice Functional Mixin

Advice (License: MIT, npm: advice) by Martin Angers is inspired by Angus Croll's functional mixin example. It can be used to modify an object with after, before, and around methods:

var myObj = { fn: function() {} }
  , withAdvice = require('advice');

myObj.before(fn, function() {
  // Things that should happen before fn

// the 'before' method will now run automatically

The author has kindly included thorough Mocha tests as well.


Buildify (License: MIT, npm: buildify) by Charles Davison is a build script API:

var buildify = require('buildify');

  .concat(['part1.js', 'part2.js'])
  .wrap('../lib/template.js', { version: '1.0' })


MaDGe (License: MIT, npm: madge) by Patrik Henningsson generates graphs based on CommonJS or AMD dependencies. It can generate various output including text-based lists in the console, and PNGs using Graphviz. There are lots of commnad-line options, which can be loaded from a JSON file.

This example shows the result of using MaDGe with Express: