Giter Club home page Giter Club logo

weathercli's Introduction

CLI Weather App

Libraries Used

  • Yargs - for command line handling -
  • Inquirer - for command prompts
  • Got - for API requests

Features

  • Minimal interface
  • Geolocation auto-configuration (disabled by default - use flag --geo or --geolocation)
  • NodeJS ESM modules
  • ES6 Syntax

Install

git clone repository
yarn install in repository root

open './utils/defaultConfig.js' and enter your OpenWeather API Key

run npm link

How to Use

weathercli [flags]
Flags help - to list all flags and get help
weathercli --help
import a config with one or multiple locations
weathercli --import ./path-to-file    

Config example - Single Location

{"zipcode":"1000","units":"celsius","city":"skopje","country":"mk","defaultQuery":{"zipcode":false,"city":true}} 

Config example - Multiple Locations

[
      {"zipcode":"1000","units":"c","city":"Skopje","country":"MK","defaultQuery":{"zipcode":false,"city":true}},
      {"zipcode":"7000","units":"f","city":"Bitola","country":"MK","defaultQuery":{"zipcode":false,"city":true}}
]

Help

Options:
  --version                 Show version number                        [boolean]
  --import                  Path to JSON config file
  --help                    Show help                                  [boolean]
  --city, -c                City name
  --units, -u               Units by which temperature is displayed
                                    [choices: "f", "c", "celsius", "fahrenheit"]
  --zipcode, -z             Zipcode and country code Zipcode and country code
                    flag separated by space (ex: 7000 MK)                [array]
  --latest, -l              Fetch the latest weather query             [boolean]
  --geolocation, -g, --geo  Use geolocation to auto-configure and display the
                            weather.                  [boolean] [default: false]

weathercli's People

Contributors

mihajlobt avatar

Watchers

James Cloos avatar  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.