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

weather-information-api

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

weather-information-api

A simple JavaScript package to fetch weather information from OpenWeatherMap API.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Weather Information API

A simple JavaScript package to fetch weather information from OpenWeatherMap API.

Installation

You can install the package via npm:

npm install weather-information-api

Usage

First, import the WeatherAPI class from the package:

const WeatherAPI = require('weather-information-api');

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

const apiKey = 'YOUR_API_KEY';
const weather = new WeatherAPI(apiKey);

You can fetch weather data by city name using the getWeatherByCity method:

const cityWeather = await weather.getWeatherByCity('London');
console.log('Weather in London:', cityWeather);

Or you can fetch weather data by coordinates using the getWeatherByCoordinates method:

const coordWeather = await weather.getWeatherByCoordinates(51.51, -0.13);
console.log('Weather at coordinates:', coordWeather);

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 12 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