1This worked for me -
2
3 cron.schedule("*/10 * * * * *", function() {
4 console.log("running a task every 10 second");
5 });
6Hope this helps someone.
7
8Reference - https://support.acquia.com/hc/en-us/articles/360004224494-Cron-time-string-format
1var cron = require('node-cron');
2
3var task = cron.schedule('* * * * *', () => {
4 console.log('will execute every minute until stopped');
5});
6
7task.stop();