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-4/

Schedule Translator

Build a schedule translation tool that converts cron expressions into human-readable descriptions in multiple languages.

Capabilities

Multi-Language Schedule Display

Create a function that displays cron schedules in different languages, supporting at least three languages: English, French, and Spanish.

  • Display "*/15 * * * *" in English returns "Every 15 minutes" @test
  • Display "*/15 * * * *" in French returns "Toutes les 15 minutes" @test
  • Display "*/15 * * * *" in Spanish returns "Cada 15 minutos" @test
  • Display "0 9 * * MON-FRI" in German returns "Um 09:00, Montag bis Freitag" @test

Batch Translation

Create a function that translates multiple cron expressions into a target language at once.

  • Translate array ["0 0 * * *", "*/30 * * * *", "0 12 * * SUN"] to French, returning an array of three French descriptions @test
  • Return an empty array when given an empty array input @test

Language Availability Check

Create a function that checks if a given language code is supported.

  • Return true for "en", "fr", "es", "de", "ja", "zh_CN" @test
  • Return false for "invalid_locale" @test

Implementation

@generates

API

/**
 * Translates a cron expression to a human-readable description in the specified language
 * @param {string} cronExpression - The cron expression to translate
 * @param {string} languageCode - The target language code (e.g., "en", "fr", "es", "de")
 * @returns {string} Human-readable description in the target language
 */
export function translateSchedule(cronExpression, languageCode);

/**
 * Translates multiple cron expressions to a target language
 * @param {string[]} cronExpressions - Array of cron expressions
 * @param {string} languageCode - The target language code
 * @returns {string[]} Array of human-readable descriptions in the target language
 */
export function translateScheduleBatch(cronExpressions, languageCode);

/**
 * Checks if a language code is supported
 * @param {string} languageCode - The language code to check
 * @returns {boolean} True if the language is supported, false otherwise
 */
export function isSupportedLanguage(languageCode);

Dependencies { .dependencies }

cronstrue { .dependency }

Provides cron expression parsing and internationalization support.

@satisfied-by

Install with Tessl CLI

npx tessl i tessl/npm-cronstrue

tile.json