0.3.4 • Published 5 years ago

fixed-circular-buffer v0.3.4

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

Fixed Circular Buffer

A tiny, fast and heap safe singly-linked list of fixed-size (2048) circular buffers.

npm GitHub license Build Status Coverage Status

Installation

# npm
npm install fixed-circular-buffer

# yarn
yarn add fixed-circular-buffer

Usage

const CircularBuffer = require('fixed-circular-buffer')

const Q = new CircularBuffer()

Q.push('xyz')

Q.size        // 1
Q.length      // 2048

Q.shift()     // 'xyz'
Q.shift()     // null

let i = 2049  // data items
while (i > 0) Q.push(i -= 1)

Q.size        // 2049
Q.length      // 4096

Tests

Run tests as follows:

npm run test

License

Copyright © 2018-present Alex Masterov <alex.masterow@gmail.com>

Fixed Circular Buffer is licensed under MIT and can be used for any personal or commercial project.

0.3.4

5 years ago

0.3.3

5 years ago

0.3.2

5 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago