Skip to content

PureClarity/weather

 
 

Repository files navigation

Weather.js

GitHub license

About

Internal PureClarity Weather.js fork. Fetches data from OpenWeatherMap.

Install

Reference the master branch for this repo in the package.json.

npm install PureClarity/weather --save

Usage

Access the current weather conditions for any city. By default it will use the closest match as returned by Open Weather Map.

Weather.getCurrentCityCountry("York", 'GB', function(current) {
  console.log(
    ["currently:",current.temperature(),"and",current.conditions()].join(" ")
  );
});

Weather.getForecast("York", function(forecast) {
  console.log("Forecast High in Kelvin: " + forecast.high());
  console.log("Forecast High in Fahrenheit" + Weather.kelvinToFahrenheit(forecast.high()));
  console.log("Forecast High in Celsius" + Weather.kelvinToCelsius(forecast.high()));
});

About

Weather wrapper for OpenWeatherMapAPI

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%