If you are doing some kind of client polling from javascript, you might want to check Xb, a new tiny library for doing exponential backoff callbacks.
It works pretty well out of the box with no config at all, you can check the examples folder to get a hint of what you can implement with it.
Also if you happen to need it in a node.js script, you can easily require it with npm, just by doing:
npm install xb
from your terminal, and then require it with:
var Xb = require('xb');
Hope you find it useful, and if you don’t please let me know by creating an issue.