Skip to content

LMS5413/EventCron

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EVENT CRON - A MODULE FOR MANAGER YOUR EVENTS

Event cron - a module for manager your events using node-cron!

Installation

NPM

npm install eventcron

YARN

yarn add eventcron

USAGE

const { EventCron } = require('eventcron');
(async () => {
    const eventStarter = new EventCron({events: [{name: "event1", startIn: "02/11/2022:3:05", endIn: "02/11/2022:3:06"}]})
    const initEvent = await eventStarter.start()
    initEvent.on("eventStarted", console.log)
    initEvent.on("eventEnded", console.log)
})

EventCron Class Params

events: [{name: "Name your event", startIn: "date/hour start event (hour opcional)", endIn: "date/hour end event (hour opcional)"}],
pattern: "pattern node cron (Default value: 0 0 * * * (Every midnight))" //ATTENCION! If propriety of event startIn or endIn includes hours change pattern to */1 * * * *
timezone: "Your timezone (Default value: Timezone from Server)"

Return

name: string //Name of event,
index: number //Index of array

About

A module from events using node-cron

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published