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.
A queue persist on filesytem to save memory
$ npm install disk-queue
# or
$ pnpm add disk-queue
import { DiskQueue } from "disk-queue";
const queue = new DiskQueue({
filePath,
});
queue.push({ data: 1 });
console.log(queue.remainCount); // 1
queue.push(...[{ data: 2 }, { data: 3 }]);
console.log(queue.remainCount); // 3
console.log(queue.shift()); // {data: 1}
console.log(queue.remainCount); // 2
//...
if (queue.remainCount === 0) {
console.log(queue.shift()); // undefined
}
class of disk queue recive a options object
Type:
interface Options {
filePath: string; // filePath to persist queue
serializer?: Serializer; // default is JSON.stringify
deserializer?: DeSerializer; // default is JSON.parse
}
add items to queue work like Array#shift
dequeue a item work like Array#shift
discard jobs and reset everything
close internal file descriptor, push after close will throw fd error
The number of remaining item in queue
event triggered when queue remainCount hit zero
queue.on('drain', () => {
assert(queue.remainCount === 0)
})
event triggered when queue.reset is called
FAQs
A queue persist on filesytem to save memory
We found that disk-queue 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.