Rapidcron is the easiest way to schedule background jobs and crons for your applications. Schedule background tasks in seconds without managing any infrastructure, save money on servers, and focus on building your app.
Install the package using npm:
npm install rapidcron --save
or using yarn:
yarn add rapidcron
Initialise the Rapidcron class with your API Key
import Rapidcron from "rapidcron";
const rapidcron = new Rapidcron("API_KEY");
// Create a delayed task
await rapidcron.tasks.create({
type: "delayed",
nextRunAt: new Date(Date.now() + 1000 * 60 * 60), // 1 hour from now
request: {
method: "POST",
url: "https://example.com",
body: JSON.stringify({
hello: "world"
})
}
});
// Create a recurring task
await rapidcron.tasks.create({
type: "recurring",
recurrencePattern: "* * * * *", // Every minute
request: {
method: "POST",
url: "https://example.com",
body: JSON.stringify({
hello: "world"
})
}
});
Read the API Documentation for more information.
This project is licensed under the MIT License - see the LICENSE file for details.