# day-events

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

Latest version **1.0.1** (published 2018-03-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install day-events
pnpm add day-events
yarn add day-events
bun add day-events
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-03-25 |
| First published | 2018-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 9.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Chris Antes |
| Maintainers | doingweb |

## Links

- npm: https://www.npmjs.com/package/day-events
- Repository: https://github.com/doingweb/day-events
- Homepage: https://github.com/doingweb/day-events#readme
- Issues: https://github.com/doingweb/day-events/issues
- npm.io page: https://npm.io/package/day-events

## Dependencies (2)

- [suncalc](https://npm.io/package/suncalc.md) ^1.8.0
- [node-schedule](https://npm.io/package/node-schedule.md) ^1.3.0

## Recent versions

- 1.0.1 (latest) — 2018-03-25
- 1.0.0 — 2018-03-25

## README

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](https://github.com/mourner/suncalc#sunlight-times) and documented constants are included with the plugin.

```js
const {
  DayEvents,
  eventNames: { SUNRISE, SUNSET }
} = require('day-events');

let latitude = 45.5231;
let longitude = -122.6765;

let today = new DayEvents(latitude, longitude);

today.on(SUNRISE, () => console.log('Good morning!'));
today.on(SUNSET, () => console.log('Good evening!'));

let eventTimes = today.getTimes();
console.log(`Sunset is at ${eventTimes[SUNSET].toString()}`);
```

---
_Source: https://npm.io/package/day-events · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
