Socket
Socket
Sign inDemoInstall

x-weather

Package Overview
Dependencies
63
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    x-weather

A project to view weather information.


Version published
Weekly downloads
10
decreased by-37.5%
Maintainers
1
Install size
2.16 MB
Created
Weekly downloads
 

Readme

Source

x-weather

About

  • A web component implementing portions of the OpenWeatherMap API.

Installation

  • Method 1:

    • Install the npm package
      • npm i x-weather
    • Import the package into a project
      • import 'x-weather/lib/build-ie11-iife/iife/main'
  • Method 2:

    • Add the component via jsDelivr:
      • <script src="https://cdn.jsdelivr.net/npm/x-weather@0.0.7/lib/build-ie11-iife/iife/main.js"></script>

Add polyfills

  <div id="ce-es5-shim">
    <script>
      if (!window.customElements) {
        var ceShimContainer = document.querySelector('#ce-es5-shim')

        // This prevents custom-elements-es5-adapter.js from parsing or running.
        ceShimContainer.parentElement.removeChild(ceShimContainer)
      }
    </script>

    <!-- Required, due to a conflict between the polyfills, transpilation, and IE... -->
    <script
      charset="utf-8"
      src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/custom-elements-es5-adapter.js"
    ></script>
  </div>

  <!-- Web component polyfill (only loads what it needs) -->
  <script
    charset="utf-8"
    src="https://cdn.jsdelivr.net/npm/@webcomponents/webcomponentsjs/webcomponents-lite.js"
  ></script>

Usage

  <x-weather
    appid="NOT_A_REAL_API_KEY"
    host="api.openweathermap.org"
    location="Phoenix, Arizona"
  >
    <x-current scale="F"></x-current>
    <x-forecast scale="F"></x-forecast>
  </x-weather>

FAQs

Last updated on 03 Nov 2018

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc