Fixed-capacity circular queue
This is a Node.js module available through the
npm registry. Installation is done using the
npm install
command:
$ npm install ring-buffjs
var RingBuffer = require('ring-buffjs')
var buffer = new RingBuffer(4); // create queue with size 4
buffer.offer(1);
buffer.peek(); // => 1
buffer.poll(); // => 1