Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Client

The main client

const client = new Client();

Hierarchy

  • Client

Index

Constructors

Methods

  • Get weather alerts for a given area.

    const active = true;
    const latitude = 35.6175667;
    const longitude = -80.7709911;
    const alerts = await client.getAlerts(active, { latitude, longitude });

    Parameters

    Returns Promise<AlertsResponse>

  • Get a weather forecast for a given latitude and longitude.

    const latitude = 35.6175667;
    const longitude = -80.7709911;
    const forecast = await client.getForecast(latitude, longitude, 'baseline');

    Parameters

    Returns Promise<ForecastResponse>

  • Get latest weather observation for a given station.

    const latestObservation = await client.getLatestStationObservations('KSFO');
    

    Parameters

    • stationId: string

    Returns Promise<ObservationResponse>

  • getNearestStation(latitude: number, longitude: number): Promise<null | Station>
  • Get the closest weather station for a given latitude and longitude.

    const latitude = 35.6175667;
    const longitude = -80.7709911;
    const stationOrNull = await client.getNearestStation(latitude, longitude);

    Parameters

    • latitude: number
    • longitude: number

    Returns Promise<null | Station>

  • Get weather observations for a given station.

    const observations = await client.getStationObservations('KSFO');
    

    Parameters

    • stationId: string

    Returns Promise<ObservationsResponse>

  • Get the closest weather stations for a given latitude and longitude.

    const latitude = 35.6175667;
    const longitude = -80.7709911;
    const stations = await client.getStations(latitude, longitude);

    Parameters

    • latitude: number
    • longitude: number

    Returns Promise<StationsResponse>

Generated using TypeDoc