@squawk
    Preparing search index...

    Function parseMetar

    • Parses a raw METAR or SPECI string into a structured Metar object.

      Handles both US (FAA) and ICAO format METARs including CAVOK, QNH altimeter settings, and NOSIG trend indicators.

      import { parseMetar } from '@squawk/weather';

      const metar = parseMetar('METAR KJFK 041853Z 21010KT 10SM FEW250 18/06 A3012 RMK AO2 SLP203 T01830061');
      console.log(metar.stationId); // "KJFK"
      console.log(metar.wind?.speedKt); // 10
      console.log(metar.flightCategory); // "VFR"

      Parameters

      • raw: string

        The raw METAR or SPECI string to parse.

      Returns Metar

      A parsed Metar object.

      If the string cannot be parsed as a valid METAR/SPECI.