npm install ec-weather-js
First, fetch weather data for a certain station from Environment Canada's RSS feed. This will provide XML data, so parse as text.
(This library does not fetch data.)
Next, pass this data into the Weather constructor:
const Weather = require('ec-weather-js'); const weather = new Weather(fetchedXMLWeatherData);
Or just the current conditions:
Or the forecast for a specific date:
Weekly and Hourly Forecasts
will return an array of the respective forecasts.
.winds to further narrow the array.
returns an array of precipitation forecasts by the hour.
Pull requests are welcome. For major changes, please open an issue first to discuss.
Make sure to update tests as appropriate.