Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@t0ri/openweathermap-essentials

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@t0ri/openweathermap-essentials

Receive only the essential data back from the OpenWeatherMap API in an easy-to-navigate Weather object.

  • 1.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

OpenWeatherMap Essentials

Receive only the essential data back from the OpenWeatherMap API in an easy-to-navigate Weather object.

Weather {
  cloudiness: 90,
  sun: { 
    rise: '7:07:21',
    set: '16:51: 6'
  },
  location: {
    city: 'San Francisco',
    country: 'US',
    timezone: -28800
  },
  temp: {
    current: 55.8,
    min: 51.8,
    max: 60.01
  },
  air: {
    humidity: 82,
    pressure: 1018
  },
  type: {
    description: 'Rain',
    detailedDescription: 'light rain'
  },
  wind: {
    direction: 'NE',
    speed: 3
  },
  zip: 94108,
  apiKey: 'YOUR_KEY_HERE',
  units: 'imperial'
}

Getting Started

Create a new Weather object, passing in options in an object.

Options include apiKey (string), zip (number), and an optional units argument.

The units option accepts "imperial", "standard", or "metric" but will default to "imperial".

const weather = new Weather({ apiKey: 'YOUR_KEY_HERE', zip: 94108, units: 'imperial' })

Interpreting Data

Cloudiness

cloudiness returns the percentage of cloudiness (number)

Sun

sun.rise and sun.set return a formatted time string in the timezone local to the zip code (string)

Location

location.city returns the city name belonging to the zip code (string)

location.country returns the country name belonging to the zip code (string)

location.timezone returns the millisecond offset between your computer's time and the time local to the zip code (number)

Temp

temp.current returns the current temperature in the specified zip code (number)

temp.min returns the minimum temperature in the specified zip code (number)

temp.max returns the maximum temperature in the specified zip code (number)

Air

air.humidity returns the humidity percentage in the zip code (number)

air.pressure returns the atmospheric pressure in the zip code in hPa (number)

Type

type.description returns a short description of the weather in a zip code (string)

type.detailedDescription returns a long description of the weather in a zip code (string)

Wind

wind.direction returns the direction the wind is blowing in a zip code (string)

wind.speed returns the speed the wind is blowing in a zip code (number)

FAQs

Package last updated on 16 Jul 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc