2.3.8 • Published 11 months ago

@egeonu/weather v2.3.8

Weekly downloads
-
License
-
Repository
github
Last release
11 months ago

Weather

A react component utilizing open-meteo. It also includes a function for retrieving open-meteo data restructured to be more user friendly.

Installation

npm install @egeonu/weather

Usage

getWeatherOpenMeteo

import React from 'react'
import ReactDOM from 'react-dom/client';
import { getWeatherOpenMeteo } from '@egeonu/weather';
  // Accepts url
  let url = (latitude: number, longitude: number) => "https://api.open-meteo.com/v1/forecast?latitude=" + latitude + "&longitude=" + longitude + "&hourly=temperature_2m,relative_humidity_2m,precipitation_probability,weather_code,wind_speed_10m,wind_direction_10m";

  const weather = await getWeatherOpenMeteo(url(32.679420,-97.028336),'f');
  console.log(weather);

Expected output

Example Output This example shows how we budle all the data by date and hours. The object type for each forcast is defined to be any since it accepts a url and parameters can change.

ReactWeather

import React from 'react'
import ReactDOM from 'react-dom/client';
import ReactWeather from '@egeonu/weather';

const root = ReactDOM.createRoot(
  document.getElementById('root') as HTMLElement
);

root.Weather(
    <ReactWeather longitude={-97.028336} latitude={32.679420} temperature_unit='f' wind_speed_unit='mph'/>
);

Example Output

alt text

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate.

2.3.8

11 months ago

2.3.7

11 months ago

2.3.6

11 months ago

2.3.5

11 months ago

2.3.4

11 months ago

2.3.3

11 months ago

2.3.2

11 months ago

2.3.1

11 months ago

2.3.0

11 months ago

2.2.9

11 months ago

2.2.8

12 months ago

2.2.7

12 months ago

2.2.6

12 months ago

2.2.5

12 months ago

2.2.4

12 months ago

2.2.3

12 months ago

2.2.2

12 months ago

2.2.1

12 months ago

2.2.0

12 months ago

2.1.0

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago