Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

cron-converter-u2q

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cron-converter-u2q

Converts cron expressions between unix and quartz formats

latest
Source
npmnpm
Version
1.2.1
Version published
Maintainers
1
Created
Source

cron-converter-u2q

Github Repo Stars NPM version GitHub License GitHub Build Github Release Github Top Language npm downloads

https://nodei.co/npm/cron-converter-u2q.png?downloads=true&downloadRank=true&stars=true

A powerful TypeScript library for working with cron expressions. Effortlessly convert between Unix and Quartz formats, generate human-readable descriptions, and validate cron expressions with ease.

✨ Features

🔄 Two-way Conversion

  • Unix to Quartz: Convert standard Unix cron expressions to Quartz format
  • Quartz to Unix: Convert Quartz cron expressions to standard Unix format
  • Format Validation: Built-in validation for both formats
  • Error Handling: Clear error messages for invalid expressions

📝 Human-readable Descriptions

  • Natural Language: Convert cron expressions to plain English
  • Multiple Languages: Support for different language descriptions
  • Customizable: Extend with your own description templates
  • Detailed: Includes all schedule details (minutes, hours, days, etc.)

🛠️ Developer Friendly

  • TypeScript Support: Full type definitions included
  • Zero Dependencies: Lightweight and fast
  • Well Tested: Comprehensive test coverage
  • ES6 Modules: Support for both CommonJS and ES6 imports

🔍 Validation & Error Handling

  • Format Validation: Ensures cron expressions are valid
  • Range Checking: Validates field values within acceptable ranges
  • Clear Errors: Descriptive error messages for debugging
  • Type Safety: TypeScript types for better development experience

📦 Installation

# Using npm
npm install cron-converter-u2q

# Using yarn
yarn add cron-converter-u2q

# Using pnpm
pnpm add cron-converter-u2q

🚀 Quick Start

import { CronConverterU2Q } from 'cron-converter-u2q';

// Convert Unix to Quartz
const quartzExpression = CronConverterU2Q.unixToQuartz('5 * * * *');
console.log(quartzExpression); // "0 5 * * * ? *"

// Convert Quartz to Unix
const unixExpression = CronConverterU2Q.quartzToUnix('0 0 8 * * ?');
console.log(unixExpression); // "0 8 * * *"

// Get human-readable description
const description = CronConverterU2Q.describeUnix('*/5 * * * *');
console.log(description); // "Every 5 minutes"

📚 Examples

Basic Conversions

// Unix to Quartz
CronConverterU2Q.unixToQuartz('0 12 * * *');     // "0 0 12 * * ? *"
CronConverterU2Q.unixToQuartz('*/15 * * * *');   // "0 */15 * * * ? *"

// Quartz to Unix
CronConverterU2Q.quartzToUnix('0 0 8 * * ?');    // "0 8 * * *"
CronConverterU2Q.quartzToUnix('0 */5 * * * ?');  // "*/5 * * * *"

Human-readable Descriptions

// Unix format descriptions
CronConverterU2Q.describeUnix('0 12 * * *');     // "At 12:00 PM"
CronConverterU2Q.describeUnix('*/15 * * * *');   // "Every 15 minutes"

// Quartz format descriptions
CronConverterU2Q.describeQuartz('0 0 8 * * ?');  // "At 8:00 AM"
CronConverterU2Q.describeQuartz('0 */5 * * * ?'); // "Every 5 minutes"

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

  • Fork the repository
  • Create your feature branch (git checkout -b feature/amazing-feature)
  • Commit your changes (git commit -m 'Add some amazing feature')
  • Push to the branch (git push origin feature/amazing-feature)
  • Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

💬 Support

🙏 Acknowledgments

  • Thanks to all contributors who have helped shape this project
  • Inspired by the need for a simple, reliable cron expression converter
  • Built with TypeScript for better developer experience

Keywords

cron

FAQs

Package last updated on 01 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts