Skip to content
  • Other
  • weather
  • sun
  • moon
  • air-quality
  • elevation
  • environment
  • lookup
License
MIT
Published
September 11, 2026
Pinned commit
11ed3dd
Rating
No ratings yet
Forks
2
Adaptation effort
—

@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, summarizeAirQuality on 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

  1. No secrets or OAuth integrations. Public Open-Meteo / Nominatim only.
  2. Weather and forecast caches live in this package's durable storage (keys weatherCache and forecastHistory). Former oversized user values were retired 2026-07-27.
  3. getHomeAirQuality() / summarizeAirQuality() default to Highland, UT; pass location or coordinates to override.
  4. Agents: see AGENTS.md for import paths and smoke checks.

Done when

  • Root overview or summarizeAirQuality() / ./snapshot returns without error
  • You can resolve a place with ./weather-geocode and 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)
Report this listing

Log in to report this listing.