Socket
Socket
Sign inDemoInstall

vktech-cli-weather

Package Overview
Dependencies
1
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    vktech-cli-weather

get weather info using cli


Version published
Maintainers
1
Created

Readme

Source

Get Weather Info - CLI Utility

This package uses Open Weather API to fetch weather data. So it's mandatory to register and get the API KEY.

Installation

Install this package as a dev dependency

npm i -D vktech-cli-weather

To obtain API Key

  • Visit OpenWeather
  • SignIn to your account. Please create account if you don't have one.
  • Then visit API Keys page
  • Generate your api key

Once you obtained your api key, goto your application root directory and create .env file if not exist. Then add environment variable like below.

WEATHER_API=YOUR_API_KEY

How to run

  • First, you should have the package installed.
  • Then in your cmd terminal, type vktech-cli-weather and press ENTER
  • You will now see below output
>vktech-cli-weather
? Enter the location chennai

Sample Success Response

{
  "isSuccess": true,
  "msg": {
    "location": "chennai",
    "coord": {
      "lon": 80.2785,
      "lat": 13.0878
    },
    "weather": [
      {
        "id": 701,
        "main": "Mist",
        "description": "mist",
        "icon": "50n"
      }
    ],
    "base": "stations",
    "main": {
      "temp": 29.98,
      "feels_like": 36.78,
      "temp_min": 28.99,
      "temp_max": 29.98,
      "pressure": 1015,
      "humidity": 77
    },
    "visibility": 4000,
    "wind": {
      "speed": 2.06,
      "deg": 50
    },
    "clouds": {
      "all": 40
    },
    "dt": 1697983270,
    "sys": {
      "type": 2,
      "id": 2012809,
      "country": "IN",
      "sunrise": 1697934603,
      "sunset": 1697976993
    },
    "timezone": 19800,
    "id": 1264527,
    "name": "Chennai",
    "cod": 200
  }
}

Sample Failure Response

{
  "isSuccess": false,
  "msg": "Invalid API key."
}

Keywords

FAQs

Last updated on 22 Oct 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc