Schedule JavaScript functions with Cronit

Have you ever dreamed of being able to easily schedule the execution of JavaScript code snippets without having to configure any servers? Thanks to the addition of NodeJS scripting support in our online cron job execution tool, this is now possible with Cronit.

How does it work?

Cronit is an online recurring job scheduling and execution application. To use our application, simply connect to our website via the following address:

Once connected, you will have access to an interface allowing you to easily define a list of tasks that you want to execute periodically.

Simply create a new job by clicking on the "New cron" button. Once this is done, you will be able to define which task you want to run recurrently, how, and when. All you have to do is select the "script" option in the menu defining your cron execution.

How to define my JavaScript task

Once the JavaScript mode is activated, you will have access to a piece of example code illustrating the features available in Cronit. This code snippet shows you the following.

Each script element must be defined with the following code:

module.exports = async () => { console.log(value); }

From this script, you have access to a wide range of functionality. First of all, you have access to all the standard JavaScript functions. For example, you can manipulate lists, math operations, and dates, ...

We have also provided you with access to a library of functions, which allow you:

Make HTTP calls:

let {data, status} = http.get('')

Connect to a database:

let connexion = database({ client: 'mysql', connection: { host : '', port : 3306, user : 'your_database_user', password : 'your_database_password', database : 'myapp_test' } }); connection('table') .insert({a: 'b'}) .returning('*') .toString();

Or access a cache system that allows you to convert values between two code executions:

let value = await cache.get('mykey'); if(!value) await cache.set('mykey', JSON.stringify({today: new Date()}), 1000);