Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 534 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 534 Bytes

sunrise-js

Based on the sunrise equation calculates a Javascript UTC Date approximating when sunrise and sunset will happen based on a specified latitude, longitude and Javascript Date.

Largely inspired by the rust-sunrise crate.

Usage

const twilight = require('sunrise-js');
const { sunrise, sunset } = twilight(
    { latitude: 0, longitude: 0 },
    new Date('2023-02-10')
);