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.
@egomobile/queue-mongo
Advanced tools
Queue storage for @egomobile/queue, using MongoDB as backend.
Execute the following command from your project folder, where your package.json
file is stored:
npm install --save @egomobile/queue-mongo
import { Queue } from "@egomobile/queue";
import {
IMongoQueueStorageOptions,
MongoQueueStorage,
} from "@egomobile/queue-mongo";
import { MongoClient } from "mongodb";
let queue!: Queue;
async function main() {
const url = process.env.MONGO_URL?.trim() || "mongodb://localhost:27017";
const mongoClient = new MongoClient(url);
const db = mongoClient.db("my_database");
const storageOptions: IMongoQueueStorageOptions = {
getDb: () => {
return db;
},
};
queue = new Queue({
storageClass: MongoQueueStorage,
storageClassArgs: [storageOptions],
});
// register 2 tasks at once
queue.register({
// 1st
myTask1: async (context) => {
console.log("This is task 1 with following data:", context.data);
},
// 2nd
myTask2: async (context) => {
console.log("This is task 2 with following data:", context.data);
},
});
// anything is prepared, lets start the queue
await queue.start();
// first enqueue 2nd task
await queue.enqueue("myTask2", {
data: {
buzz: 5979,
},
});
// then 1st one
await queue.enqueue("myTask1", {
data: {
foo: "bar",
},
});
}
main().catch(console.error);
The API documentation can be found here.
FAQs
Queue storage for node-queue, using MongoDB as backend.
The npm package @egomobile/queue-mongo receives a total of 6 weekly downloads. As such, @egomobile/queue-mongo popularity was classified as not popular.
We found that @egomobile/queue-mongo demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers 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.