api-weather

Simple way to use OpenWeatherMap API.

Usage no npm install needed!

<script type="module">
  import apiWeather from 'https://cdn.skypack.dev/api-weather';
</script>

README

Installation

Use npm to install api-weather.

npm i api-weather

Usage

Async/Await

const {getWeather} = require("api-weather");
async function gW(){
    const data = await getWeather("Mexico",key,lang,unit);
    console.log(data);
}

gW();

Promise

const {getWeather} = require("api-weather");

getWeather("Mexico",key,lang,unit).then(data=>{
    console.log(data);
});

This is a simple way to use. The param Key it should be the api key from https://openweathermap.org/ . And the param lang is the language of the output, by default is english. The param unit is the unit for the degrees, it can be F,C or K;

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.