npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@archishman2005/adiyogi-weather-sdk

v1.0.0

Published

Comprehensive TypeScript SDK for Adiyogi Weather API - High-precision weather, climate, and environmental data

Readme

Adiyogi Weather SDK (TypeScript)

npm version License: MIT

A comprehensive, fully-typed TypeScript SDK for accessing high-precision weather, climate, and environmental data.

📦 Installation

npm install @adiyogi/weather-sdk

Or with yarn:

yarn add @adiyogi/weather-sdk

🚀 Quick Start

import { AdiyogiClient } from '@adiyogi/weather-sdk';

const client = new AdiyogiClient({
  apiKey: process.env.ADIYOGI_API_KEY // Optional
});

// Get current weather
const weather = await client.weather.getCurrent({
  lat: 40.7128,
  lon: -74.0060
});

console.log(`Temperature: ${weather.temperature}°C`);
console.log(`Condition: ${weather.condition}`);

🌟 Features

  • Fully Typed - Complete TypeScript definitions
  • Async/Await - Modern promise-based API
  • Tree-shakable - Import only what you need
  • Zero Dependencies - Lightweight and fast
  • Error Handling - Comprehensive error types
  • Browser & Node.js - Works everywhere

📚 Services

Weather Forecast

// Get 7-day forecast
const forecast = await client.weather.getForecast({
  lat: 52.52,
  lon: 13.41,
  days: 7,
  includeHourly: true
});

forecast.daily.forEach(day => {
  console.log(`${day.date}: ${day.temperature.max}°C`);
});

Historical Data

// Get historical weather data
const historical = await client.historical.getWeather({
  lat: 52.52,
  lon: 13.41,
  startDate: '2023-01-01',
  endDate: '2023-01-31',
  variables: ['temperature', 'precipitation']
});

Air Quality

// Get current air quality
const airQuality = await client.airQuality.getCurrent({
  lat: 28.61,
  lon: 77.20
});

console.log(`AQI: ${airQuality.aqi}`);
console.log(`PM2.5: ${airQuality.pm25}`);

Marine Data

// Get marine forecast
const marine = await client.marine.getForecast({
  lat: 35.6762,
  lon: 139.6503,
  days: 3
});

console.log(`Wave height: ${marine.waveHeight}m`);

Elevation

// Get elevation data
const elevation = await client.elevation.getElevation({
  lat: 47.5162,
  lon: 14.5501
});

console.log(`Elevation: ${elevation.altitude}m`);

Geocoding

// Search for locations
const results = await client.geocoding.search({
  query: 'London'
});

results.forEach(location => {
  console.log(`${location.name}, ${location.country}`);
});

🔧 Advanced Configuration

const client = new AdiyogiClient({
  apiKey: 'your-api-key',
  baseURL: 'https://api.adiyogi.com',
  timeout: 10000,
  retries: 3,
  cache: true
});

🎯 React Hook

import { useWeather } from '@adiyogi/weather-sdk/react';

function WeatherWidget() {
  const { data, loading, error } = useWeather({
    lat: 40.7128,
    lon: -74.0060,
    refreshInterval: 60000 // Refresh every minute
  });

  if (loading) return <Spinner />;
  if (error) return <Error message={error.message} />;

  return (
    <div>
      <h2>{data.temperature}°C</h2>
      <p>{data.condition}</p>
    </div>
  );
}

📖 API Reference

Client Methods

  • client.weather.getCurrent(options) - Current weather
  • client.weather.getForecast(options) - Weather forecast
  • client.historical.getWeather(options) - Historical data
  • client.airQuality.getCurrent(options) - Air quality
  • client.marine.getForecast(options) - Marine forecast
  • client.elevation.getElevation(options) - Elevation data
  • client.geocoding.search(options) - Location search
  • client.climate.getProjections(options) - Climate projections
  • client.solar.getRadiation(options) - Solar radiation

TypeScript Types

interface WeatherOptions {
  lat: number;
  lon: number;
  units?: 'metric' | 'imperial';
}

interface ForecastOptions extends WeatherOptions {
  days?: number;
  includeHourly?: boolean;
}

interface HistoricalOptions extends WeatherOptions {
  startDate: string;
  endDate: string;
  variables?: string[];
}

⚠️ Error Handling

try {
  const weather = await client.weather.getCurrent({ lat: 40.7, lon: -74 });
} catch (error) {
  if (error instanceof NetworkError) {
    console.error('Network issue:', error.message);
  } else if (error instanceof ValidationError) {
    console.error('Invalid parameters:', error.message);
  } else {
    console.error('Unknown error:', error);
  }
}

🧪 Testing

npm test

📄 License

MIT License - see LICENSE for details

🤝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for details.

🔗 Links

📞 Support

For support, email [email protected] or open an issue on GitHub.