A simple ring buffer data structure for Node.js and the browser