Socket
Socket
Sign inDemoInstall

weather-api-data

Package Overview
Dependencies
3
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    weather-api-data

NPM package that gets information about weather


Version published
Weekly downloads
1
Maintainers
1
Install size
438 kB
Created
Weekly downloads
 

Readme

Source

weather-api-data

weather-api-data
  • NPM package that gets information about weather

Installation from NPM

npm install weather-api-data
  • loction(country_name) - Get a weather in country

Examples

Using await

const weather = require('weather-api-data');

async function getWeather() {
    const data = await weather.loction('manama');
    console.log(data);
}
getWeather();

Using .then function

const weather = require('weather-api-data');
weather.loction('manama').then(weather => console.log(weather));

Output

{
  location: {
    name: 'Manama',
    region: 'Al Manamah',
    country: 'Bahrain',
    lat: 26.24,
    lon: 50.58,
    tz_id: 'Asia/Bahrain',
    localtime_epoch: 1624817976,
    localtime: '2021-06-27 21:19'
  },
  current: {
    last_updated_epoch: 1624817700,
    last_updated: '2021-06-27 21:15',
    temp_c: 32,
    temp_f: 89.6,
    is_day: 0,
    condition: {
      text: 'Clear',
      icon: '//cdn.weatherapi.com/weather/64x64/night/113.png',
      code: 1000
    },
    wind_mph: 8.1,
    wind_kph: 13,
    wind_degree: 100,
    wind_dir: 'E',
    pressure_mb: 1002,
    pressure_in: 30.1,
    precip_mm: 0,
    precip_in: 0,
    humidity: 71,
    cloud: 0,
    feelslike_c: 38.9,
    feelslike_f: 102,
    vis_km: 10,
    vis_miles: 6,
    uv: 8,
    gust_mph: 22.6,
    gust_kph: 36.4
  }
}

Keywords

FAQs

Last updated on 22 Jul 2021

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