Skip to content

Dids/weatherwoman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A Node.js module for the Dark Sky API (previously known as Forecast.io).

Based on Brian Hines's weatherman.io.

Install it

 npm install weatherwoman

Require it

var weatherwoman = require("weatherwoman");

Create a weatherwoman

var carolKirkwood = new weatherwoman("your-dark-sky-api-key");

Create a weatherwoman with options

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

Do the forecast from a location

var forecastOptions =
{
    latitude: 41.8854710,
    longitude: -87.6430260
};

carolKirkwood.doForecast(forecastOptions, function(err, weatherReport)
{
    if (err)
    {
        // handle any errors
    }
    // do something with the weatherReport
});

Do the forecast for a specific time (Unix timestamp)

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

About

A Node.js module for the Dark Sky API (previously Forecast.io).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published