You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

weather-handler

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weather-handler

A NodeJS library for interfaceing with OpenWeatherMap.

2.0.6
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

weather-handler

A NodeJS library for interfacing with OpenWeatherMap.
Get your OpenWeatherMap key from here: https://openweathermap.org/api

Install

$npm install weather-handler

Usage

const weatherHandler = require('weather-handler'),
      weather = new weatherHandler('OPENWEATHERMAP KEY');

weather.setUnit('metric'); // Metric, Imperial, Kelvin 

let dataByZip = await weather.getByZip('ZIP'); // Or ('ZIP','County Code')
let dataByName = await weather.getByName('NameOfCity');   // Or ('City','County Code')
let dataByCoords = await weather.getByCoords('13','61');
let dataByID = await weather.getByID('13613613'); //OpenWeatherMaps City ID's

console.log(data); 

Example

const weatherHandler = require('weather-handler'),
      weather = new weatherHandler(KEY);

async function Main(){
    let data = await weather.getByName('Moscow','RU');
    console.log(data);
}Main();

Keywords

weather

FAQs

Package last updated on 02 Feb 2019

Did you know?

Socket

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