Skip to content

A Node.js command line application for accessing the weather

License

Notifications You must be signed in to change notification settings

fwzmhmd/weather-command-line

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather Command Line

A Node.js command line application for accessing the current weather

Getting Started

Clone the repository

$ git clone [email protected]:fwzmhmd/weather-command-line.git

Prerequisites

Install Node.js from the Official Website

Check if you have node installed

$ node -v

API Key

Sign Up

  1. Go to OpenWeatherMap to get an API Key

  2. Create an Account

Imgur

  1. Goto API keys tab

Imgur

  1. Copy API Key

Imgur

Connect API

  1. Create a file called api.json
  2. Copy/Paste the following:
{
    "key": "<api-key>"
}
  1. Replace <api-key> with your key from OpenWeatherMap
  2. Save the file

How to Use

Search a location by City

$ node app.js city-name
$ node app.js city-name,country-code

Search a location by ZIP Code

$ node app.js zip-code,country-code

If country code is not specified with zip code then the search works for USA as a default

$ node app.js zip-code

Examples

Search a location by City

$ node app.js london
$ node app.js london,uk
$ node app.js paris

Search a location by ZIP Code

$ node app.js 94040,us

If country code is not specified with zip code then the search works for USA as a default

$ node app.js 94040

Authors

Fawaz Mohamed - Github

License

This project is licensed under the MIT License - see LICENSE file for details

Acknowledgments

  • OpenWeatherMap for API

Releases

No releases published

Packages

No packages published