Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
pythagorean-cache
Advanced tools
🍷A cache that dumps when full or at an interval
import { PythagoreanCache } from 'pythagorean-cache';
// dump when size reaches 10
const cache = new PythagoreanCache<string>({ size: 10 });
cache.on('dump', () => {
/* do something with 10 items */
});
for (let x = 0; x < 10; x++) {
cache.push(`Hello ${x}`);
}
dump
event is fired with all the items in the cache and then emptieddump
event. This can be used to dump the cache at regular intervals.These options can be combined, allowing you to create a cache that dumps at a certain size or at a certain interval.
I was receiving a bursting stream of events I needed to add to a database. Instead of inserting each one as they come in, it was more efficient to do bulk inserts at intervals/sizes. This way that database was protected from burst events and I could expect the events to be inserted within a certain amount of time regardless.
FAQs
A cache that empties when full or at an interval
The npm package pythagorean-cache receives a total of 2 weekly downloads. As such, pythagorean-cache popularity was classified as not popular.
We found that pythagorean-cache 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.