This CLI app pulls a summary of weather information of the day for the region defined by the argument and saves the data to a file. Utilizes the Node.js runtime. It pulls location data from the Mapbox Geocoding API and weather data from the OpenWeather One Call API.
-
Can pull precison weather data from a country to down to a street address.
-
Option to choose between showing Celsuis or Fareinheit temperatures, or show both!.
-
Saves output data to text file.
Ensure node.js is installed in your system.
Clone this repo:
$ git clone https://github.com/kencruz/weather-cli.git && cd weather-cli
Install the dependencies:
$ npm install
Create a .env
file at the project root with your OpenWeather API key
and Mapbox access token
.
OPEN_WEATHER_API=
MAPBOX_API=
For showing celsius temperatures, add --celsius
or -c
to the location query.
$ npm start -- Toronto -c
For showing farhenheit temperatures, add --farhenheit
or -f
to the location query.
$ npm start -- Toronto -f
Add both flags to display both units!
Weather data queries are saved to weather.txt