Skip to content

Rapidcron/rapidcron-js

Repository files navigation

Rapidcron

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.

npm version

Installation

Install the package using npm:

npm install rapidcron --save

or using yarn:

yarn add rapidcron

Usage

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.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Node.js SDK for Rapidcron

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published