npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@t0ri/openweathermap-essentials

v1.0.4

Published

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

Downloads

8

Readme

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)