CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cronstrue

Convert cron expressions into human readable descriptions

Overall
score

100%

Overview
Eval results
Files

task.mdevals/scenario-6/

Cron Schedule Display Tool

Build a utility function that converts cron expressions into human-readable descriptions, with special support for time specification nicknames.

Requirements

Your function should:

  1. Accept cron expressions as string input
  2. Support special time specification nicknames (like @yearly, @monthly, @weekly, @daily, @hourly, @reboot)
  3. Return human-readable descriptions of the cron schedules
  4. Throw errors for invalid input

Implementation

@generates

API

/**
 * Converts a cron expression to a human-readable description
 * @param {string} expression - The cron expression to convert
 * @returns {string} Human-readable description of the schedule
 */
function describeCron(expression) {
  // IMPLEMENTATION HERE
}

module.exports = { describeCron };

Capabilities

Special Time Nicknames

The tool should recognize and convert standard cron time specification aliases:

  • Converting "@yearly" returns "At 12:00 AM, on day 1 of the month, only in January" @test
  • Converting "@monthly" returns "At 12:00 AM, on day 1 of the month" @test
  • Converting "@weekly" returns "At 12:00 AM, only on Sunday" @test
  • Converting "@daily" returns "At 12:00 AM" @test
  • Converting "@hourly" returns "Every hour" @test

Alternative Nicknames

  • Converting "@annually" returns "At 12:00 AM, on day 1 of the month, only in January" @test
  • Converting "@midnight" returns "At 12:00 AM" @test

Special Startup Nickname

  • Converting "@reboot" returns "Run once, at startup" @test

Error Handling

  • When given an invalid cron expression, the function throws an error @test
  • When given an empty string, the function throws an error @test

Dependencies { .dependencies }

cronstrue { .dependency }

Provides cron expression to human-readable text conversion.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-cronstrue

tile.json