@selinac887/weather-sdk
v1.0.5
Published
A lightweight TypeScript SDK for the [Open-Meteo](https://open-meteo.com/) API, providing access to current weather and forecast data.
Readme
Weather SDK
A lightweight TypeScript SDK for the Open-Meteo API, providing access to current weather and forecast data.
Features
- Current weather
- Hourly and daily forecast
Installation
npm install @selinac887/weather-sdkUsage
Get current weather
import { getCurrentWeather } from "@selinac887/weather-sdk";
const data = await getCurrentWeather({
latitude: -36.85,
longitude: 174.76,
current: [
"temperature_2m",
"wind_speed_10m",
"weather_code"
]
});
console.log(data.current.temperature_2m);Get forecast weather
import { getForecast } from "@selinac887/weather-sdk";
const forecast = await getForecast({
latitude: -36.85,
longitude: 174.76,
hourly: ["temperature_2m", "relative_humidity_2m"],
daily: ["temperature_2m_max", "precipitation_sum"],
forecastDays: 3
});