Based on Brian Hines's weatherman.io.
npm install weatherwoman
var weatherwoman = require("weatherwoman");
var carolKirkwood = new weatherwoman("your-dark-sky-api-key");
var options =
{
units: "uk",
exclude: ["minutely", "alerts"],
extend: "hourly"
};
var carolKirkwood = new weatherwoman("your-dark-sky-api-key", options);
Detailed information about each of these options is available in the Dark Sky developer docs: https://darksky.net/dev/docs
var forecastOptions =
{
latitude: 41.8854710,
longitude: -87.6430260
};
carolKirkwood.doForecast(forecastOptions, function(err, weatherReport)
{
if (err)
{
// handle any errors
}
// do something with the weatherReport
});
var forecastOptions =
{
latitude: 41.8854710,
longitude: -87.6430260,
time: 1395347280
};
carolKirkwood.doForecast(forecastOptions, function (err, weatherReport)
{
if (err)
{
// handle any errors
}
// do something with the weatherReport
});