Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
@jakubzet/use-openweathermap-api
Advanced tools
Readme
React hook for fetching and displaying weather data using OpenWeatherMap API
npm install --save @jakubzet/use-openweathermap-api
import * as React from "react";
import { useOpenWeatherMapAPI } from "@jakubzet/use-openweathermap-api";
const Example = () => {
const [state, fetchWeather] = useOpenWeatherMapAPI({
key: "REPLACE_ME_WITH_API_KEY",
queryConfig: {
cityName: "Warszawa",
countryCode: "pl"
},
queryType: "name",
units: "metric"
});
return (
<main>
<h1>Demo of useOpenWeatherMapAPI hook</h1>
<section>
<h4>Loading state:</h4>
<p>{state.pending ? "true" : "false"}</p>
</section>
<section>
<h4>Error:</h4>
<p>
{state.error
? `Error: ${state.error.cod} - ${state.error.message}`
: "Nope"}
</p>
</section>
<section>
<h4>Data:</h4>
{state.data && state.data.name && state.data.main ? (
<>
<p>Weather in {state.data.name}:</p>
<ul>
<li>Currently: {state.data.main.temp} degrees</li>
<li>Max: {state.data.main.temp_max} degrees</li>
<li>Min: {state.data.main.temp_min} degrees</li>
</ul>
</>
) : (
<p>Nope</p>
)}
</section>
<button onClick={fetchWeather}>
Fetch data (please remember to add your API key to config beforehand)
</button>
</main>
);
};
MIT © jakubzet
FAQs
React hook for fetching and displaying weather data using OpenWeatherMap API (https://openweathermap.org/)
The npm package @jakubzet/use-openweathermap-api receives a total of 0 weekly downloads. As such, @jakubzet/use-openweathermap-api popularity was classified as not popular.
We found that @jakubzet/use-openweathermap-api demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.