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

ao-weather-widget

v1.0.4

Published

A weather widget to get current weather is global cities

Downloads

16

Readme

ao-weather-widget

A weather widget to get current weather in global cities

NPM JavaScript Style Guide

Install

npm install --save ao-weather-widget

Usage

import React from 'react'
import WeatherWidget from 'ao-weather-widget'

const App = () => {
  return <WeatherWidget city='London' apiToken={process.env.REACT_APP_API_TOKEN} />
}

return default App

You can create an API Token using the OpenWeather pages here: https://home.openweathermap.org/api_keys

Options

There are 3 configuration options for the WeatherWidget component:

  • city (required): The city that should be used with the OpenWeatherAPI to get current weather data
  • apiToken (required): The OpenWeather API Token that can be used to interact with the OpenWeatherAPI. You can create an account and generate an API key here: https://home.openweathermap.org/api_keys
  • fill: Declares wether the component should fill the container it has been placed inside. Defaults to false.

Development choices & assumptions

NPM Package

I made the choice to develop this component and release it as a fully fledged NPM package to ease integration into other projects and to maintain a release history for future development

SCSS

SCSS was used to build the styles for the WeatherWidget. The additional complexities that SCSS offers over standard CSS allows me to quickly build a set of classes for layouts, spacings and colors that be used site wide with ease. The SCSS classes have been stored in modules to avoid interaction with any styles defined in parent applications.

Standard JavaScript

I have chosen not to implement this version of the package with TypeScript as it is a small project with a single developer and also to speed up time to release.

Colorblindness

The most common type of color vision anomaly is deuteranomaly which involves reduced sensitivity. The colors used within the WeatherWidget have been chosen to limit the impact of this impairment.

Colour blindness

Future development

Future development tasks could include:

  • A built in dropdown selector for the cities with data in the OpenWeatherAPi
  • Additional configuration options for font styles, text colors and custom backgrounds
  • A 3D globe with locations of the cities selected shown

License

MIT © AlphaOmeKilo