node schedule every minute

const schedule = require('node-schedule');

// Define the schedule rule for running the task every minute
const rule = new schedule.RecurrenceRule();
rule.second = 0; // Run the task at the 0th second of every minute

// Create the scheduled job with the defined rule
const job = schedule.scheduleJob(rule, function(){
    // Task to be executed every minute
    console.log('Task executed at: ', new Date());
});