Socket
Socket
Sign inDemoInstall

weather-data-collector

Package Overview
Dependencies
8
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

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.


Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Install size
9.53 MB
Created
Weekly downloads
 

Readme

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

Last updated on 04 Mar 2024

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