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 around 15 seconds, with substantially improved positional accuracy over the earlier release. It ships as a modern ES module while retaining bundled support for CommonJS and direct browser use.
Features
- Sun position calculations
- Sunrise, sunset, and twilight times
- Moon position and distance
- Moonrise, moonset, and lunar phase
- High-precision astronomical models
- ES module, CommonJS, and browser support
Categories
LibrariesLicense
BSD LicenseFollow SunCalc
Other Useful Business Software
Build Agents and Models on One Platform
Gemini Enterprise Agent Platform is Google Cloud's comprehensive platform for developers to build, scale, govern, and optimize agents and models. Choose from Google's most advanced models and third-party models like Anthropic's Claude Model Family.
Rate This Project
Login To Rate This Project
User Reviews
Be the first to post a review of SunCalc!