Skip to content

marcusedwardhaslam/sunrise-js

Repository files navigation

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')
);

About

A way to determine when the sun will rise and set based on your latitude

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published