Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

openweathermap-fetcher

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

openweathermap-fetcher

A Wrapper for openweathermap API for node application.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

Openweathermap-fetcher

A fetcher for openweathermap api.Currently in initial stage.

Prerequisite

To use this package API key of openweathermap is needed. To get this you need to

  1. Go to openweathermap website.
  2. Create an free account.
  3. Login wto your account and get the API Key.

currently tested on free account openweather API.

Installation

you can install this package using below npm command

npm install openweathermap-fetcher

or

yarn add openweathermap-fetcher

Usage


import { OpenWeatherMap } from 'openweathermap-fetcher';

const apiKey='your_api_key';

const openweathermap = new OpenWeatherMap({apiKey});

async function run() {
    try {
      const data = await openweathermap.fetchWeatherDataByCityName("Delhi");
      console.log("API Result:", data);
    } catch (error) {
      console.error("API Error:", error.message);
    }
  }
  
  run();

Method

  1. fetchWeatherDataByCityName(cityName:string) The method will fetch the weather data by taking cityname as an argument and returns weather data.

  2. fetchWeatherDataByCoordinates(latitude:string,longitude:string) This method will fetch the weather data by taking longitude and latitude as an argument and returns weather data.

  3. fetchForecastDataByCityName(cityName:string) The method will fetch the forecast data by taking cityname as an argument and returns weather data.

  4. fetchForecastDataByCoordinates(latitude:string,longitude:string) This method will fetch the forecast data by taking longitude and latitude as an argument and returns weather data.

Contribution

We welcome contributions! If you'd like to contribute to openweathermap-wrapper, please follow our Contribution Guidelines.

Author

Subramanya KS

License

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

Keywords

FAQs

Package last updated on 18 Nov 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