New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

openweather

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openweather

Simple Weather Retrieval Module for http://openweathermap.org/

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

#openweather

Simple Weather Retrieval Module for http://openweathermap.org/

Version

1.0.4

Installation

$ npm i --save openweather

Usage

Obtain api "key" from http://openweathermap.org/ after registration. It is called "APPID". You may load it as an environment variable or include it as an optional parameter.

var openWeather = require('openweather');

// Returns data from open weather using desired 
// coordinates, city name, or zip code from a object or city name:

openWeather.getWeather(coords, function(result){
  console.log(result);
}, [key]);

// Example coordinate object:
{"latitude": 37, "longitude": -122 }

// Example city object. Country is optional  
{
    "city": "San Francisco",
    "country": "ca"
}

// Example zip code object

{
    "zip": "94115"
}


// Example data from result includes temperature 
// in Kelvins, Fahrenheit, and Celsius:
{
  "lon": -123.12,
  "lat": 49.25,
  "city": "Vancouver",
  "country": "CA",
  "sunset": 1467433243,
  "sunrise": 1467375137,
  "humidity": 68,
  "pressure": 1019,
  "icon": "http://openweathermap.org/img/w/04d.png",
  "weather": "Clouds",
  "weatherDes": "broken clouds",
  "windSpeed": 3.6,
  "avgTempK": 293.07,
  "minTempK": 289.15,
  "maxTempK": 296.48,
  "avgTempC": 19.92,
  "minTempC": 16,
  "maxTempC": 23.33,
  "avgTempF": 67.86,
  "minTempF": 60.8,
  "maxTempF": 73.99
}

};

License

MIT

FAQs

Package last updated on 05 Jul 2016

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