Novice, Practiced, Mastered
Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

aws-cron-parser

1.1.5 • Public • Published

AWS Cron Parser

circleci benchmark codacy

This utility was built to process AWS Cron Expressions used by Amazon CloudWatch. It can support all the specs listed in the link below, including the special wildcards L W and #.

Specs

AWS Cron Expression specs

Usage

There are only 3 methods: parse, next, and prev

import awsCronParser from "aws-cron-parser";
 
// first we need to parse the cron expression
const cron = awsCronParser.parse("9 * 7,9,11 5 ? 2020,2022,2024-2099");
 
// to get the first occurrence from now
let occurrence = awsCronParser.next(cron, new Date());
 
// to get the next occurrence following the previous one
occurrence = awsCronParser.next(cron, occurrence);
 
// and use prev to get the previous occurrence
occurrence = awsCronParser.prev(cron, occurrence);

Install

npm i aws-cron-parser

DownloadsWeekly Downloads

161

Version

1.1.5

License

MIT

Unpacked Size

14.3 kB

Total Files

9

Last publish

Collaborators

  • avatar