This is a personal project made to learn a little bit about CLI's. It's a simple CLI that fetches weather data from a specific city, returning current local time and temperature, feels like, humidity and wind speed.
- NodeJS v.20 or higher
If you use NVM, just run nvm use
inside of the root folder.
After cloning this repository, run the following command inside the root folder to install the project globally and allow you to use the commands at any directory you are, even if it's not the project's folder.
$ npm install -g .
Now you're good to go.
This project accepts two units of measurement: metric and imperial. This option is not required, but, if you don't pass it, the default unit is going to be metric
and local datetime format will be DD/MM - HH:mm
. If you pass imperial
as an option, all weather data will be displayed in Fahrenheit
and local datetime format will be MM/DD HH:mm AM/PM
.
Usage: weather [options]
A CLI to check the weather from a city.
Options:
-V, --version Output the version number
-c, --city <value> Enter the city name
-u, --units <value> Choose units of measurement
-h, --help Display help for command
Examples:
weather -c "Curitiba"
weather -c "London" -u imperial
Examples:
Default:
Passing unit as an option: