Skip to main content

Access Yr.no's weather API.

Works with
This package works with Bun
This package works with Deno
JSR Score
64%
Published
a week ago (2.1.0)

Access Yr's weather API for getting weather forecast about a specific location.

Example for current weather

import { getCurrent } from 'https://deno.land/x/dyr/mod.ts';

const currentWeather = getCurrent('Bergen');
// do what you need to do with the weather data.

Example for forecasted weather

import { getForecast } from 'https://deno.land/x/dyr/mod.ts';

const location = 'Bergen';
const hoursAhead = 5;

const currentWeather = getForecast(location, hoursAhead);

Add Package

deno add @timharek/d-yr

Import symbol

import * as mod from "@timharek/d-yr";

Add Package

bunx jsr add @timharek/d-yr

Import symbol

import * as mod from "@timharek/d-yr";