1.0.3 • Published 10 months ago

croninja v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

croninja logo

Introduction

A lightweight cron time parser

Code Samples

INPUT

const { Croninja } = require("croninja")

const cron = Croninja({
    second: 10,
    minute: 2,
    hour: 1,
    day: 0,
    month: 0,
  });

If current time is for e.g 2023 July 23 SUN 13:43:20, cronjob will run after 1 hour 2 minutes and 10 seconds (at 2023 July 23 SUN 14:45:40)

OUTPUT

40 45 14 23 7 * 

List of parameters

ParametersTypeDescription
offsetsobjectrequired (fields in object: second, minute, hour, day and month)
dayOfWeekstringoptional (value must be mon, tue, wed, thu, fri, sat or sun)

Installation

NPM:

npm install croninja

Yarn:

yarn add croninja
1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago