Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
@danieldiekmeier/async-worker
Advanced tools
npm i @danieldiekmeier/async-worker
Do you have a task that needs to run every now and then? Do you not want to worry about setting up a cronjob, but also not just slap a setInterval
on it and call it a day? Then this package is the middle ground for you.
Put your worker logic somewhere in your application logic, reuse all your stuff, it's going to be fine!
✨ async/await is fully supported and encouraged ✨
Here is a code example:
import Worker from '@danieldiekmeier/async-worker'
new Worker({
// This function is called on every task execution.
async task () {
await database.removeOldStuff()
},
// Set the minimum time between task executions, in milliseconds (ms).
// In this case, it would run once per hour.
interval: 60 * 60 * 1000,
// Whenever the task errors, this function is called with the error.
onError (err) {
fancyLogger(err)
}
})
The Worker doesn't start the task if the previous execution is still running. That way, you don't have to worry about having long running tasks like complex database cleanup or slow download tasks.
FAQs
A simple worker to do work in intervals
The npm package @danieldiekmeier/async-worker receives a total of 0 weekly downloads. As such, @danieldiekmeier/async-worker popularity was classified as not popular.
We found that @danieldiekmeier/async-worker 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.