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

@storm-pkg/weather

v1.0.11

Published

<p align="left"> <img src="https://raw.githubusercontent.com/jeetadhikari92/w-lib/master/projects/docs/assets/w.png" width="200" height="200"> </p>

Downloads

4

Readme

@storm-pkg/weather

Collection of Weather widgets and services to easily build weather application in minutes.

Table of Contents

Installation

First you need to install the npm module:

npm install @storm-pkg/weather

Choose the version corresponding to your Angular version:

Angular | @storm-pkg/weather ----------- | ------------------- 8 | 1.0.10 7 | 1.0.10

Usage

0. Get a free OpenWeather Api key

Signup by clicking the link and get a free API key which is required to run this library. https://home.openweathermap.org/users/sign_up

1. Provide the WeatherIntercepter:

Finally, you can use @storm-pkg/weather in your Angular project. You have to import WeatherModule in the root NgModule of your application as shown below and enter your configuration.

import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {HTTP_INTERCEPTORS, HttpClient } from '@angular/common/http';
import {WeatherModule} from '@storm-pkg/weather';

@NgModule({
    imports: [
        BrowserModule,
        WeatherModule.withConfig({
            appId: <Your App Id from Open Weather APIs>,
            unit: <Your choice of unit. metric or imperial>
        })
    ],
    bootstrap: [AppComponent]
})
export class AppModule { }

This will handle all the Weather related apis centrally and add the Application Id that you provide to each apis. It will also take care of error handling.

Development

1. Using the WCity:

This module allows you to render a single Weather widget for a city.

Import the module in your NgModule

To use the WCityWidget you need to import the WCityodule. Do as follows:

import {WCityModule} from '@storm-pkg/weather';

@NgModule({
    ...
    imports: [
        ...
        WCityModule
    ],
    ...
})
export class AppModule { }
Add the selector lib-w-city
  • After the module is registered you can use the WCity widget selector in your component template and pass a city name like this
<lib-w-city [city]="'Paris'"></lib-w-city>
  • We can also pass a selected boolean value to display if the particular city is selected.
<lib-w-city [city]="'Amsterdam'" [selected]="true"></lib-w-city>
  • We can also write proper styles to change the look of the widgets for example
<lib-w-city 
    style="background: #2ec7c0; color: white; border-radius: 5px"
    [city]="'Paris'">
</lib-w-city>