api-weather

1.3.2 • Public • Published

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.

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i api-weather

    Weekly Downloads

    1

    Version

    1.3.2

    License

    ISC

    Unpacked Size

    3.35 kB

    Total Files

    4

    Last publish

    Collaborators

    • rogeliolb