weather-handler
A NodeJS library for interfaceing with OpenWeatherMap.
Last updated 9 months ago by l33 .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install weather-handler 
SYNC missed versions from official npm registry.

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();

Current Tags

  • 2.0.6                                ...           latest (9 months ago)

9 Versions

  • 2.0.6                                ...           9 months ago
  • 2.0.5                                ...           9 months ago
  • 2.0.4                                ...           9 months ago
  • 2.0.3                                ...           9 months ago
  • 2.0.2                                ...           9 months ago
  • 2.0.1                                ...           9 months ago
  • 2.0.0                                ...           9 months ago
  • 1.0.1                                ...           10 months ago
  • 1.0.0                                ...           10 months ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 0
Last Week 3
Last Month 18
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |