@raflicvc/c-weather
v1.0.0
Published
Simple weather checker for all cities using Open-Meteo and OpenStreetMap
Maintainers
Readme
c-weather
Simple Node.js weather package to check current weather in all cities worldwide.
Powered by:
- OpenStreetMap (Nominatim)
- Open-Meteo API
No API key required.
Installation
npm install c-weather
Usage
Basic Example
const { getWeather } = require("c-weather")
async function run() { const data = await getWeather("Jakarta") console.log(data) }
run()
Returned Data
{ "location": "Jakarta, Indonesia", "latitude": "-6.1754", "longitude": "106.8272", "temperature": 30.2, "windspeed": 12.3, "winddirection": 180, "weathercode": 3, "time": "2026-01-18T10:00" }
Error Handling
try { await getWeather("unknowncity") } catch (e) { console.error(e.message) }
Weather Code Reference
Weather codes follow Open-Meteo standard:
- 0 = Clear sky
- 1–3 = Cloudy
- 45–48 = Fog
- 51–67 = Rain
- 71–77 = Snow
- 80–99 = Thunderstorm
License
MIT License
