Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cron-validate

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cron-validate

[![typescript](https://camo.githubusercontent.com/56e4a1d9c38168bd7b1520246d6ee084ab9abbbb/68747470733a2f2f62616467656e2e6e65742f62616467652f69636f6e2f547970655363726970743f69636f6e3d74797065736372697074266c6162656c266c6162656c436f6c6f723d626c756526636f6c

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
427K
increased by38.7%
Maintainers
1
Weekly downloads
 
Created

What is cron-validate?

The cron-validate npm package is used to validate and parse cron expressions. It ensures that cron expressions are syntactically correct and can be used to schedule tasks in a reliable manner.

What are cron-validate's main functionalities?

Basic Validation

This feature allows you to validate a basic cron expression. The code sample checks if the cron expression '0 0 * * *' is valid.

const cronValidate = require('cron-validate');
const result = cronValidate('0 0 * * *');
console.log(result.isValid()); // true

Custom Validation Options

This feature allows you to validate a cron expression with custom options. The code sample uses a preset option to validate the cron expression.

const cronValidate = require('cron-validate');
const options = { preset: 'npm-package' };
const result = cronValidate('0 0 * * *', options);
console.log(result.isValid()); // true

Detailed Error Messages

This feature provides detailed error messages for invalid cron expressions. The code sample demonstrates how to get an error message for an invalid cron expression.

const cronValidate = require('cron-validate');
const result = cronValidate('invalid-cron');
console.log(result.getError()); // Detailed error message

Other packages similar to cron-validate

Keywords

FAQs

Package last updated on 15 Apr 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc