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

weather-data-collector

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weather-data-collector

A package to collect weather data for a specific location using the weather-information-api.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Weather Data Collector

A package to collect weather data for a specific location using the weather-information-api.

Installation

You can install the package via npm:

npm install weather-data-collector

Usage

First, import the WeatherCollector class from the package:

const WeatherCollector = require('weather-data-collector');

Then, create an instance of WeatherCollector with your OpenWeatherMap API key:

const apiKey = 'YOUR_API_KEY';
const collector = new WeatherCollector(apiKey);

You can fetch weather data for a location using the getWeatherForLocation method:

const city = 'London';
try {
  const weatherData = await collector.getWeatherForLocation(city);
  console.log('Weather in London:', weatherData);
} catch (error) {
  console.error(error.message);
}

Replace 'YOUR_API_KEY' with your actual OpenWeatherMap API key.

License

This project is licensed under the MIT License - see the LICENSE file for details.

FAQs

Package last updated on 04 Mar 2024

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