Socket
Socket
Sign inDemoInstall

api-weather

Package Overview
Dependencies
2
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    api-weather

Simple way to use OpenWeatherMap API.


Version published
Weekly downloads
15
increased by1400%
Maintainers
1
Install size
398 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 21 Feb 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc