DEV Community

Cover image for SunCalc: Sun, Moon, and Twilight Data in JavaScript
jQueryScript
jQueryScript

Posted on

SunCalc: Sun, Moon, and Twilight Data in JavaScript

SunCalc: a dependency-free JavaScript library for calculating solar and lunar data from a date, latitude, and longitude.

It returns:

  • Sun altitude and compass direction.
  • Sunrise, sunset, dawn, dusk, and golden-hour times.
  • Moonrise, moonset, lunar phase, and illumination data.
  • Custom solar thresholds for blue-hour interfaces.

👉 Blog Post

👉 GitHub Repo

👉 Live Demo

Top comments (0)