Tags » Node

WebSocket sessions in NodeJS with Express

WebSockets is an advanced technology that makes it possible to open an interactive communication session between the user’s browser and a server. With this API, you can send messages to a server and receive event-driven responses without having to poll the server for a reply. However, keeping track of sessions in both HTTP and WebSocket…

Continue →

Deferrables

Imagine, if you will, some JavaScript models that look something like this: function User (…) { // initialise user } User.fromId = function (id, cb) { // 'returns' an error, or a User db.find(…, cb); } User.prototype.getGroups = function (cb) { // 'returns' an error, or an array of Groups db.find(…, cb); } function Group…

Continue →