Security News
The Risks of Misguided Research in Supply Chain Security
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
cbuffer-fusion
Advanced tools
The end goal of this project is to implement the entire JavaScript Array.prototype
, and some
additional utility methods, as a circular buffer.
Note: This is called a circular buffer because of what this library accomplishes, but is implemented as an Array. This may be confusing for Node users, which may want to use a true Buffer.
While the entire Array.prototype
API is on the roadmap, it's not all quite here. Below is the
currently implemented API.
It's simple. Just use it like you would use an Array.
new CBuffer(10); // empty buffer with length of 10
new CBuffer(1,2,3,4); // buffer with length 4
CBuffer(5); // For those who are really lazy, new is optional
Included are several non-standard niceties. Like if you want to catch when data is overwritten,
just assign a function to the overflow
variable and it will be called whenever a value is about
to be overwritten and it will pass the value as the first argument:
var myBuff = CBuffer(4);
myBuff.overflow = function(data) {
console.log(data);
};
myBuff.push(1,2,3,4); // nothing shows up yet
myBuff.push(5); // log: 1
sort
, the default comparitor sorts by a > b
.value
would be inserted into a sorted circular buffer ranked by an optional comparitor.Array.length = 0
.FAQs
Circular Buffer JavaScript implementation
We found that cbuffer-fusion 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
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.