/Nodejs-Weather-CLI

A simple command-line weather tool that allows you to get current weather information about the given location.

Primary LanguageJavaScript


Nodejs-Weather-CLI

npm

About

A simple command-line weather tool that allows you to get current weather information about the given location. The application is written in JavaScript and uses the OpenWeatherMap API to fetch weather data for one day.

Getting Started

Prerequisites

Installation

# Install it globally
$ npm install -g cli-weather-forecast

Usage

To use the application, first you need to get an API key from OpenWeatherMap API. A free account is all that is needed. Once you have your API key, you can use it to get the weather forecast.

Usage: 
  $ weather 

Options:
  Without parameters - weather output
  -c [CITY_NAME] Set the city name
  -h             Print this help text
  -t [API_KEY]   Save the API token

Example using the weather command:

weather -c kiev -t YOUR_API_KEY

Optionally, you can omit the API key and city name. In order to do that, you have to set the environment variables simultaneously.

How to do it in Windows:

TOKEN=YOUR_API_KEY 

CITY=YOUR_CITY_NAME