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); // 10console.log(metar.flightCategory); // "VFR" Copy
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); // 10console.log(metar.flightCategory); // "VFR"
The raw METAR or SPECI string to parse.
A parsed Metar object.
If the string cannot be parsed as a valid METAR/SPECI.
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.