Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ring-buffer-ts

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ring-buffer-ts

A circular array buffer written in modern TypeScript.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by10.05%
Maintainers
1
Weekly downloads
 
Created
Source

Ring Buffer

Aka "circular buffer" written in TypeScript

  • Well tested.
  • Documentation (included declaration types and doc-comments).
  • Clean and modern code.
  • Written in TypeScript (strict mode and strongly typed).
  • Easy API.
  • High performance when adding items.
  • No dependencies.
  • NodeJS, Browser.
  • Tiny size.

Missing feature? Note that you can export and import the buffer as array and you can do what ever you want with the array. You can also consider to create an issue here and pull-request to add features.

Install

npm i ring-buffer-ts

NPM Package

Usage

import { RingBuffer } from 'ring-buffer-ts';

const ringBuffer = new RingBuffer<number>(5);
ringBuffer.add(1);
ringBuffer.add(2, 3);
ringBuffer.add(4, 5, 6);

console.log(ringBuffer.toArray());
// Result: [2, 3, 4, 5, 6]

Documentation

Keywords

FAQs

Package last updated on 23 Nov 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc