easy-circular-buffer
v1.0.1
Published
Easy to use and high performance circular buffer
Downloads
11
Maintainers
Readme
easy-circular-buffer
Easy to use and high performance circular buffer
Installation
npm i easy-circular-buffer
Usage
const { createCircularBuffer } = require('easy-circular-buffer')
const cb = createCircularBuffer(length)
Methods
cb.insert()
<void> Insert item into circular buffer.cb.peekNewest()
<any> Returns the newest item inserted in the circular buffer.cb.peekOldest()
<any> Returns the oldest item inserted in the circular buffer.cb.toArray()
<Array<any>> Returns an array sorted from oldest (at index 0) to newest item.