Primus, it.js, highcharts-ng

2013-07-05 00:00:00 +0100 by Alex R. Young



Primus (GitHub: 3rd-Eden / primus, License: MIT, npm: primus) by Arnout Kazemier is a wrapper for various popular real-time frameworks. It allows you to switch between SocketJS, Engine.IO, or Socket.IO.

The biggest problems always happen when you deploy your application to production servers. This is when they receive large quantities of traffic and small bugs can lead to major disasters. Wouldn't it be nice to be able to switch between real-time servers when they are the source of your issues without having to rewrite your application?

It includes client-side hooks, so both your Node and browser-based code can be written independent of the underlying communication layer. The APIs are event-based, and documentation and tests have been included.


it.js (GitHub: dtinth / it.js, License: MIT, npm: it.js) by Thai Pangsakulyanont is a small functional library inspired by Q and Underscore for creating accessor and iterator callbacks. It's chainable, which means you can do this:


Instead of this:

function(person) { return person.first.length; }

Wrappers for boolean operators have been included, so your chains can include logic:

// these three are equivalent to function(x) { return !x.last }
console.log(_.select(addressBook, It.not(It.get('last'))));
console.log(_.select(addressBook, It.get('last').not()));
console.log(_.select(addressBook, It.not('last')));


highcharts-ng (GitHub: pablojim / highcharts-ng, License: MIT) by Barry Fitzgerald is an AngularJS directive for Highcharts. Barry says this demonstrates how easy it is to use third-party JavaScript with AngularJS. He's posted an example on jsFiddle.

Here's a snippet of how it looks just so you can see that it looks like idiomatic AngularJS code:

var myapp = angular.module('myapp', ['highcharts-ng']);

myapp.controller('myctrl', function($scope) {
  $scope.addPoints = function() {
    var seriesArray = $scope.chart.series
    var rndIdx = Math.floor(Math.random() * seriesArray.length);
    seriesArray[rndIdx].data = seriesArray[rndIdx].data.concat([1, 10, 20]);