Skip to content

Repository files navigation

Day Events

Event emitter for daily events like sunrise, sunset, dawn, dusk, etc.

Usage

DayEvents is an EventEmitter that will emit events as they happen during the day, in real time. The events come from the SunCalc library and documented constants are included.

const{
DayEvents,eventNames: {SUNRISE,SUNSET}}=require('day-events');letlatitude=45.5231;letlongitude=-122.6765;lettoday=newDayEvents(latitude,longitude);today.on(SUNRISE,()=>console.log('Good morning!'));today.on(SUNSET,()=>console.log('Good evening!'));leteventTimes=today.getTimes();console.log(`Sunset is at ${eventTimes[SUNSET].toString()}`);

About

Event emitter for daily events like sunrise, sunset, dawn, dusk, etc.

Topics

Resources

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages