CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-cronstrue

tessl install tessl/npm-cronstrue@3.2.0

Convert cron expressions into human readable descriptions

Agent Success

Agent success rate when using this tile

100%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.12x

Baseline

Agent success rate without this tile

89%

task.mdevals/scenario-10/

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

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/cronstrue@3.2.x
tile.json