Parses Cron (UNIX) into a string.
Cron
parseCronUnix({ dayOfMonth: "*", dayOfWeek: "*", hours: "*", minutes: "*", month: "*",}); // "* * * * *"parseCronUnix({ dayOfMonth: [1, 2], dayOfWeek: [1, 2], hours: [1, 2], minutes: [1, 2], month: [1, 2],}); // "1,2 1,2 1,2 1,2 1,2"parseCronUnix({ dayOfMonth: { from: 1, to: 2 }, dayOfWeek: { from: 1, to: 2 }, hours: { from: 1, to: 2 }, minutes: { from: 1, to: 2 }, month: { from: 1, to: 2 },}); // "1-2 1-2 1-2 1-2 1-2"parseCronUnix({ dayOfMonth: { every: 2, start: 1 }, dayOfWeek: { every: 2, start: 1 }, hours: { every: 2, start: 1 }, minutes: { every: 2, start: 1 }, month: { every: 2, start: 1 },}); // "1/2 1/2 1/2 1/2 1/2"parseCronUnix({ dayOfMonth: { nearest: 2 }, dayOfWeek: { last: 1 }, hours: "*", minutes: [{ from: 1, to: 2 }, 3, 4], month: ["SEP", "OCT"],}); // "1-2,3,4 * 2W SEP,OCT 1L"parseCronUnix({ dayOfMonth: undefined, dayOfWeek: "*", hours: "*", minutes: "*", month: "*",}); // undefined
A string or undefined if invalid.
undefined
Cron (UNIX) to be parsed.
Parses
Cron
(UNIX) into a string.Example
Returns
A string or
undefined
if invalid.