Giter Site home page Giter Site logo

be-node-weather-melaniesilies's Introduction

Weather CLI

Get the latest weather report - from your terminal!

What you will be doing

You will be writing a CLI application which uses an external API to get weather information.

The user will provide a city name when they run the program. Your program must use that city name in its request - and print the results into the terminal.

Example

Command
$ node weather.js manchester
Response
@@@@@@@@@@@@@@@@@@@
@ WEATHER PROGRAM @
@@@@@@@@@@@@@@@@@@@

It is now 15.25°C in Manchester

The current weather conditions are: scattered clouds

Tasks

Task 1 - Getting an API

  1. There are many weather APIs to choose one. Sign up for a free account from one API on the list below, or find your own;

  2. Make note of your API key. You will need this later.

  3. Read through the API documentation to understand how to use it

Task 2 - Setting up the project

  1. Initalize npm with the npm init -y command
  2. Install the axios library - we will use this to create our network requests
  3. Install the dotenv library - we will use it to create our environment variables
  4. Create the file weather.js

Task 2 - The API key

  1. Create the file .env

  2. Inside this file, store your API key

    Example
    KEY = 32476f984jf83jf9fdksu32928475
    
  3. Create a .gitignore file, and add the reference .env

Task 3 - Making the request

Inside weather.js;

  1. Read the city from the user

    Hint: You can use process.argv

  2. Import and use the dotenv library to read the API key from your process.env environment
  3. Import and use the axios to request the information from the API

Task 4 - The output

Read through the returned data from your API and display;

  • The city name
  • The current temperature
  • The current weather conditions
  • Anything else you might like to add

Hint: You might also like to consider using the colors.js library to make your output fabulous 🤩!

Bonus Tasks

Your program should be also able to;

  • Display a 5-day forecast
  • Allow the user to switch between metric and imperial measurements

be-node-weather-melaniesilies's People

Contributors

github-classroom[bot] avatar melaniesilies avatar

Watchers

Frederik (Rick) Reich avatar Joel Peltonen avatar Maximilian Faust avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.