![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@simpleview/async-cron
Advanced tools
Simple cron job runner for Node that handles async functions and uses a Mutex
that keeps the same job from running more than once simultaneously.
npm install @simpleview/async-cron
const { Job } = require("@simpleview/async-cron");
const job = new Job({
schedule : "*/5 * * * * *"
}, async function() {
const results = await doSomething();
return someResult;
});
// Required: Handle errors, or they will be black-holed resulting in not knowing that your crons are failing
job.on("error", function(e) {
console.log("Cron Error", e);
});
// Not required: if you care about the returned result from a cronJob, you can do something with it here
job.on("result", function(result) {
});
// Starts the job running the background
job.start();
If your job errors, the error will be blackholed unless you subscribe to the error handler.
job.on("error", function(e) {
// do something with the error
});
If you want to differentiate errors from the job running from code errors, you can check the error code
.
const { Job, E_RUNNING } = require("@simpleview/async-cron");
const job = new Job(...args...);
job.on("error", function(e) {
if (e.code === E_RUNNING) {
console.log("Still running!");
} else {
console.log("An actual code problem!");
}
});
Job
represents a single cron job.
string
- The schedule in cron-parser syntax.function
or async function
- The function that will execute your job. It should either run fully synchronously, or be an async method/promise-based method. Do not utilize callbacks here, or else the async locking mechanism will not function properly. When this function returns, the job must be complete.Starts the job running in the background.
Stops the job. This will not halt functions that are currently executing at this very moment, but it will present new runs from queuing up.
Manually executes the job. If the job errors, then this will throw, this includes throwing if the job is currently executing.
const result = await job.run();
Check if the job is currently running.
const isRunning = job.isRunning();
Symbol reference for error.code
when an Error
is thrown due to an a job already running. See error handling.
FAQs
Async cron job runner using cron syntax
The npm package @simpleview/async-cron receives a total of 49 weekly downloads. As such, @simpleview/async-cron popularity was classified as not popular.
We found that @simpleview/async-cron demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 8 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.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.