Cron Parser is a command-line application/script that parses a cron string and expands each field to show the times at which it will run.
- Parses standard cron format with five time fields: minute, hour, day of month, month, and day of week, plus a command.
- Handles wildcard
*
, specific values, intervals, ranges, and lists in cron strings. - Provides output in a formatted table for easy understanding.
- Clone the repository:
git clone https://github.com/Dhroov7/deliveroo-assignment
- Navigate to the project directory:
cd deliveroo-assignment
- Install dependencies:
npm install
Run the cron parser with a cron string as a single argument:
npm start "*/15 0 1,15 * 1-5 /usr/bin/find"
Input:
*/15 0 1,15 * 1-5 /usr/bin/find
Output:
Minutes: 0 15 30 45
Hours: 0
Day of month: 1 15
Month: 1 2 3 4 5 6 7 8 9 10 11 12
Day of Week: 1 2 3 4 5
Command: /usr/bin/find
To run tests, use the following command:
npm test