Package Exports
- weatherman.io
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (weatherman.io) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Install it
npm install weatherman.ioRequire it
var weatherman = require( "weatherman.io" );Create a weatherman
var alRoker = new weatherman( "your-forecast-io-api-key" );Create a weatherman with options
var options = {
units: "uk",
exclude: ["minutely", "alerts"],
extend: "hourly"
};
var alRoker = new weatherman( "your-forecast-io-api-key", options );Detailed information about each of these options is available in the Forecast.io developer docs: https://developer.forecast.io/docs/v2
Do the forecast from a location
var forecastOptions = {
latitude: 41.8854710,
longitude: -87.6430260
};
alRoker.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
};
alRoker.doForecast( forecastOptions, function ( err, weatherReport ) {
if ( err ) {
// handle any errors
}
// do something with the weatherReport
} );