🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

circularbuffer

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

circularbuffer

A small circular/ring buffer implementation in TypeScript.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

circularbuffer

A small circular/ring buffer implementation in TypeScript.

Install

# using npm
npm install --save circularbuffer

# using yarn
yarn add circularbuffer

Usage

import CircularBuffer from 'circularbuffer';

const queue = new CircularBuffer<string|number>(5);
queue.enq('foo');
queue.enq('bar', 'baz');
queue.toArray(); // ['foo', 'bar', 'baz']
queue.size; // 3
queue.capacity; // 5
queue.replace(1, 2, 3, 4, 5, 6, 7);
queue.toArray(); // [3, 4, 5, 6, 7]

Development

# build
yarn run build

# test
yarn run test

License

MIT © Vince Coppola

Keywords

buffer

FAQs

Package last updated on 15 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts