croninja
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

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

Parameters Type Description
offsets object required (fields in object: second, minute, hour, day and month)
dayOfWeek string optional (value must be mon, tue, wed, thu, fri, sat or sun)

Installation

NPM:

npm install croninja

Yarn:

yarn add croninja

/croninja/

    Package Sidebar

    Install

    npm i croninja

    Weekly Downloads

    1

    Version

    1.0.3

    License

    ISC

    Unpacked Size

    5.61 kB

    Total Files

    5

    Last publish

    Collaborators

    • nikakereselidze