← Public packages
@kentcdodds/environment
Weather, air quality, sun/moon, and outdoor environment snapshots.
README.md
38 lines · 1.8 KB · Markdown@kentcdodds/environment
Intent
Reusable environment helpers for weather, geocoding, sun times, moon phase, air
quality, elevation, forecast history, combined outdoor snapshots, and location
resolution via public Open-Meteo and Nominatim APIs. Renamed from
@kentcdodds/environment-lookups.
What it does
- Daily/hourly weather with durable cache fallback when live Open-Meteo is degraded
- Weather geocode — free-form place names or direct coordinates
- Sun — sunrise, sunset, twilight, solar noon, day length
- Moon — phase, illumination, next full/new moon (computed locally; no API)
- Air quality — hourly series plus US EPA AQI helpers (
getAirQuality,getHomeAirQuality,summarizeAirQualityon the root export) - Elevation — ground elevation via Open-Meteo Elevation API
- Forecast history — persist / read resilient forecast highs
- Snapshot — one-call weather + air quality + sun + moon; sections degrade
independently (
{ error }per section instead of throwing)
Prerequisites / setup
- No secrets or OAuth integrations. Public Open-Meteo / Nominatim only.
- Weather and forecast caches live in this package's durable storage (keys
weatherCacheandforecastHistory). Former oversized user values were retired 2026-07-27. getHomeAirQuality()/summarizeAirQuality()default to Highland, UT; passlocationor coordinates to override.- Agents: see
AGENTS.mdfor import paths and smoke checks.
Done when
- Root overview or
summarizeAirQuality()/./snapshotreturns without error - You can resolve a place with
./weather-geocodeand fetch weather/sun/moon/AQI - Snapshot sections that fail upstream return
{ error }for that section only - You use this package for outdoor AQI (Venstar exposes temp/humidity only)