
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
fixed-size-circular-array
Advanced tools
Fixed size circular array datastructure
This data structure give an fixed size array, who reuse slots by overwriting existing items and allow to move first and last indexes
Function who returns the bounded index
./src/circularIndex.mjs
./browser/circularIndex.js
const boundedindex = circularIndex.circularIndex(index, length)
./src/CircularArray.mjs
./browser/CircularArray.js
const array = ['zero', 'one', 'two', 'three', 'four']
const circularArray = CircularArray.CircularArray.fromArray(array)
circularArray.firstIndex = 2
circularArray.getItem(3) // 'zero'
circularArray.selectPrevious() // first index is now set to 1 and last index to 0
circularArray.getItem(3) // 'four'
firstIndex
firstItem
lastIndex
lastItem
static fromArray(array)
indexToVirtualIndex(index)
getItem(index)
setItem(index, value)
selectPrevious()
selectNext()
Overwritten methods:
unshift(...itemList)
push(...itemList)
shift()
pop()
And all methods of Array.prototype
with untested result
With Yarn
yarn add fixed-size-circular-array
or with NPM
npm install --save fixed-size-circular-array
FAQs
Fixed size circular array datastructure
The npm package fixed-size-circular-array receives a total of 2 weekly downloads. As such, fixed-size-circular-array popularity was classified as not popular.
We found that fixed-size-circular-array demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.