Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/radyaben/nodejs-weather-cli
A simple command-line weather tool that allows you to get current weather information about the given location.
https://github.com/radyaben/nodejs-weather-cli
cli command-line command-line-tool javascript nodejs npm openweathermap weather weather-cli weather-forecast
Last synced: 18 days ago
JSON representation
A simple command-line weather tool that allows you to get current weather information about the given location.
- Host: GitHub
- URL: https://github.com/radyaben/nodejs-weather-cli
- Owner: RadyaBen
- Created: 2022-12-13T08:43:12.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-26T14:14:46.000Z (about 2 years ago)
- Last Synced: 2024-11-09T03:38:37.935Z (2 months ago)
- Topics: cli, command-line, command-line-tool, javascript, nodejs, npm, openweathermap, weather, weather-cli, weather-forecast
- Language: JavaScript
- Homepage:
- Size: 23.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Nodejs-Weather-CLI
![npm](https://img.shields.io/npm/v/cli-weather-forecast?style=flat-square)
## 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
* [Git](https://git-scm.com)
* [Node.js](https://nodejs.org/en/download/)
* [npm](http://npmjs.com)### Installation
```sh
# 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](https://openweathermap.org/api/). A free account is all that is needed. Once you have your API key, you can use it to get the weather forecast.
```shell
Usage:
$ weatherOptions:
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_KEYCITY=YOUR_CITY_NAME
```