New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-open-weather-map

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-open-weather-map

Yet another React Weather component based on OpenWeatherMap's API

  • 2.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
26
increased by136.36%
Maintainers
1
Weekly downloads
 
Created
Source

react-open-weather-map

Yet another React Weather component based on OpenWeatherMap's API

example

Usage

Npm install using the following command:

npm i react-open-weather-map

And use it inside your React app:

import OpenWeatherMap from 'react-open-weather-map';

const props = { data: sample }; // info: sample is the response object from the OpenWeatherMap's API

<OpenWeatherMap {...props} />

Data sample:

{
  "weather": {
    "coord": {
      "lon": -0.13,
      "lat": 51.51
    },
    "weather": [
      {
        "id": 500,
        "main": "Rain",
        "description": "light rain",
        "icon": "10n"
      }
    ],
    "base": "cmc stations",
    "main": {
      "temp": 16.62,
      "pressure": 1013,
      "humidity": 88,
      "temp_min": 15,
      "temp_max": 18.5
    },
    "wind": {
      "speed": 3.6,
      "deg": 250
    },
    "rain": {
      "3h": 0.215
    },
    "clouds": {
      "all": 32
    },
    "dt": 1473541622,
    "sys": {
      "type": 1,
      "id": 5091,
      "message": 0.0107,
      "country": "GB",
      "sunrise": 1473485363,
      "sunset": 1473531820
    },
    "id": 2643743,
    "name": "London",
    "cod": 200
  }
}

Config

The component accepts a config object that can be used in order to specify:

nametypedefaultdescription
containerClassNamestring'react-open-weather-map'the container class name
import OpenWeatherMap from 'react-open-weather-map';

const config = { containerClassName: 'open-weather-map-container-class-name' };

<OpenWeatherMap config={config} />

Example

Clone or download this GitHub repository then run the example app using the following npm commands:

npm i
npm run example

Keywords

FAQs

Package last updated on 30 Oct 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc