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 🙏

© 2026 – Pkg Stats / Ryan Hefner

weather-api-lib

v1.1.4

Published

This repo contains some starter code that works with the [Open Weather Map API](https://openweathermap.org).

Downloads

3

Readme

weather-api

GitHub language count GitHub top language GitHub commit activity

For FEW 2.1 (Advanced Javascript) at Make School. Assignment #3.

https://www.npmjs.com/package/weather-api-lib

Welcome

This WeatherAPI Project is a Neumorphic Dark-Mode Weather Website.

Built in Javascript ES6 and HTML, this repo operates with Open Weather Map API.

v1.1.4

Weather Library

scripts.js contains a library that could be used by anyone who wanted to use the OpenWeatherMap API in any project they might create. There are 3 functions built into this file. You are expected to provide your own API key from openweathermap.org. index.js and index.html are included for an example of operation. The variable apiKey can be inserted in line #19 of scripts.js or imported through a config.js which was not included and should be added into your .gitignore to prevent unauthorized access.

  1. getWeatherByZip() allows searching by zip code.
  • (params) are:
    • zip: A 5 digit USA based zip code
    • apiKey: You will need to input your own API Key for your project.
    • units: No entry will default to 'imperial', but options are 'metric' or 'kelvin')
  1. getWeatherByCity() allows searching by city name.
  • params are:
    • city: City Name
    • apiKey: Your API Key
    • units
  1. getWeatherByGeo() allows searching with Latitude & Longitude.
  • params are:
    • lat: Latitude
    • lon: Longitude
    • apiKey: Your API Key
    • units

All functions take input through a single input field and resolve to a promise that returns temperature, a short weather description, what the local weather feels like and the daily minimum and maximum temperature into HTML elements. The input field can differentiate between USA Zip code, City Name or Latitude/Longitude geo coordinates.

scripts.js is a self contained library for API calls.

index.js contains the scripts that allow index.html to function which is part of this repo but not necessary for your library.

Operation

fetch() resolves promises to set the temperature, description on elements in the DOM. The getWeatherX() functions are handled by a callback. A Promise simplifies and streamline the asynchronous code. async and await keywords are used with Promise to streamline the code. Additionally, the script.js file streamlines the 'openweatherorg' API's JSON data for better organization.

The getWeatherbyX() functions are automatically chosen within the catchAllWeather() function and resolved with If statements. This is done in a separate index.js file as the scripts.js library file only contains code for reusable API calls.

Run

$ Open project in live server to run in your browser.

$ npm install for dependencies.

Updates

  1. Moved scripts from HTML into a scripts.js file.
  2. Linted with ESLINT according to Airbnb's guidelines.
  3. Added README.md