https://github.com/dids/weatherwoman
A Node.js module for the Dark Sky API (previously Forecast.io).
https://github.com/dids/weatherwoman
Last synced: 29 days ago
JSON representation
A Node.js module for the Dark Sky API (previously Forecast.io).
- Host: GitHub
- URL: https://github.com/dids/weatherwoman
- Owner: Dids
- License: other
- Created: 2016-09-30T11:07:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-09-30T11:19:17.000Z (over 9 years ago)
- Last Synced: 2025-08-02T07:25:35.168Z (10 months ago)
- Language: JavaScript
- Size: 2.93 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# A Node.js module for the Dark Sky API (previously known as Forecast.io).
*Based on Brian Hines's [weatherman.io](https://github.com/projectweekend/weatherman.io).*
### Install it
```
npm install weatherwoman
```
### Require it
```javascript
var weatherwoman = require("weatherwoman");
```
### Create a weatherwoman
```javascript
var carolKirkwood = new weatherwoman("your-dark-sky-api-key");
```
### Create a weatherwoman with options
```javascript
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](https://darksky.net/dev/docs)
### Do the forecast from a location
```javascript
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)
```javascript
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
});
```