getWeather(queryParams) function to get a
LocationForecast object by calling the "locationforecast" API.
Here's an example:
const yrno =version: '1.9' // this is the default if not provided,request:// make calls to locationforecast timeout after 15 secondstimeout: 15000;const LOCATION =// This is Dublin, Irelandlat: 533478lon: 62597;yrno;
This module exports a single factory function that can be used to get a
instance that exports the
Currently supported config options:
requestmodule. The only setting that you should need to pass is
timeoutand is demonstrated above
Returns a Promise that will resolve with a
LocationForecast object that
contains functions to get weather data. You can pass the version parameter if
you want to override the default of 1.9, or the default you supplied when
creating and instance.
Returns a Promise that resolves to an Array of 5 weather data Objects.
Returns a Promise that resolves to a weather data Object that is closest to the
time argument. The
time argument will be passed to
many time formats will work, but a millisecond timestamp or ISO formatted date
string are both ideal options to use use.
Returns the raw XML string that the
locationforecast API returned.
Returns the JSON representation of the entire
Returns the first date string that is available in the data returned from the locationforecast call.
Returns an Array of ISO timestamps that represent points in time that we have weather data for.
Some fields will be undefined depending on the weather conditions. Always
verify the field you need exists, e.g use
Can be found at this link.