Node Roundup: BinaryJS, Advice, Buildify, MaDGe
BinaryJS
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
BinaryPacka modified version of the MessagePack protocol. The Node.js server uses a modified version of thewslibrary 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');
withAdvice.call(myObj)
myObj.before(fn, function() {
// Things that should happen before fn
});
// the 'before' method will now run automatically
myObj.fn();
The author has kindly included thorough Mocha tests as well.
Buildify
Buildify (License: MIT, npm: buildify) by Charles Davison is a build script API:
var buildify = require('buildify');
buildify()
.load('base.js')
.concat(['part1.js', 'part2.js'])
.wrap('../lib/template.js', { version: '1.0' })
.save('../distribution/output.js')
.uglify()
.save('../distribution/output.min.js');
MaDGe
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:
