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

1.0.8 • Public • Published

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

Package Sidebar

Install

npm i eventcron

Weekly Downloads

2

Version

1.0.8

License

MIT

Unpacked Size

26.2 kB

Total Files

21

Last publish

Collaborators

  • lms5413