Simple exponential backoff because the others seem to have weird abstractions.
$ npm install backo
mininitial timeout in milliseconds [100]maxmax timeout [10000]jitter[0]factor[2]
varBackoff=require('backo');varbackoff=newBackoff({min: 100,max: 20000});setTimeout(function(){something.reconnect();},backoff.duration());// later when something worksbackoff.reset()MIT