Skip to content

kencruz/weather-cli

Repository files navigation

Weather CLI

preview

Overview

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.

Features

  • 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.

Getting started

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=

Usage

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

Dependencies