SunCalc
A tiny JavaScript library for calculating sun/moon positions
SunCalc is a tiny dependency-free JavaScript library for calculating solar and lunar information for any location and time. It provides sun altitude and azimuth together with sunrise, sunset, twilight, and other sunlight phases. Moon calculations include position, rise and set times, distance, and illuminated phase. Version 2 rebuilt the astronomy around higher-order models from Jean Meeus and validates results against authoritative astronomical references. Typical rise and set errors are...