1.0.3 • Published 1 year ago

egorgorban-weather-cli v1.0.3

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Weather CLI

Description

The app will help you find out the weather near your location. For that purpose it uses an external API -> https://openweathermap.org/api

✨ This is my first project on NodeJS! ✨

I'm following instructions from here.

Installation Guide

First you need to get npm and node on your machine. If you don't have it I recommend you install it through the official page.

To install CLI tool you need to execute the following command

npm i -g egorgorban-weather-cli

After that weather command should be available.

You can type the following command to make sure it works

weather --help

Options Setting

City

To set the city you need to use -c option. It's Paris by default.

weather -c Munich

Token

I do not expect my application to be very popular, so the token I'm using here is not suitable for a large number of requests.

In case the token is expired (you will see the error) you can set your own token to be able to do more requests per month.

To do this you need to sign in on https://openweathermap.org and get your personal token on this page.

Please add this token to your instance of the app via -t option.

weather -t <token>

What have I learned here

  • used http and axios to make http requests
  • made my own naive function to parse CLI arguments -> ./helpers/args.js
  • used chalk and dedent to customise the console output
  • worked with an external API with token authentication
1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago