
Product
Introducing Webhook Events for Alert Changes
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.
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.

Product
Add real-time Socket webhook events to your workflows to automatically receive software supply chain alert changes in real time.

Security News
ENISA has become a CVE Program Root, giving the EU a central authority for coordinating vulnerability reporting, disclosure, and cross-border response.

Product
Socket now scans OpenVSX extensions, giving teams early detection of risky behaviors, hidden capabilities, and supply chain threats in developer tools.