
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
ts-cron-validator
Advanced tools
A TypeScript type level CRON expression validator!
Expressions supported are the one generated and describe on crontab.guru website. This means that you can use this library to check standard CRON expressions but also non standard one. Also, this type level validator works quite well in conjunction with cron engines such as node-cron.
For a live demo, you can try this codesandbox
To install this tiny library:
npm install ts-cron-validator
Then you have the choice between two helper functions:
Below some examples that show how to use those two helpers:
import { validCronExpression, validStandardCronExpression } from 'ts-cron-validator';
validStandardCronExpression('0 3 * * * '); // OK padding accepted
validStandardCronExpression('42 * * * '); // KO missing day of week part
validStandardCronExpression('59 4 * * *'); // OK
validStandardCronExpression('60 4 * * *'); // KO incorrect minutes part
validCronExpression('20 59 4 * dec mon'); // OK non standard CRON expression are accepted
// by validCronExpression()
FAQs
TypeScript type-level CRON expression validator
The npm package ts-cron-validator receives a total of 377 weekly downloads. As such, ts-cron-validator popularity was classified as not popular.
We found that ts-cron-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.