Parses a raw TAF string into a structured Taf object.
Handles both US (FAA) and ICAO format TAFs including FM, TEMPO, BECMG, and PROB change groups, wind shear (WS), turbulence (5-group), icing (6-group), CAVOK, NSW, and cancelled (CNL) forecasts.
import { parseTaf } from '@squawk/weather';const taf = parseTaf( 'TAF KJFK 041730Z 0418/0524 21012KT P6SM FEW250 FM042200 24015G25KT P6SM SCT040 BKN080');console.log(taf.stationId); // "KJFK"console.log(taf.forecast[0].wind?.speedKt); // 12console.log(taf.forecast[1].changeType); // "FM" Copy
import { parseTaf } from '@squawk/weather';const taf = parseTaf( 'TAF KJFK 041730Z 0418/0524 21012KT P6SM FEW250 FM042200 24015G25KT P6SM SCT040 BKN080');console.log(taf.stationId); // "KJFK"console.log(taf.forecast[0].wind?.speedKt); // 12console.log(taf.forecast[1].changeType); // "FM"
The raw TAF string to parse.
A parsed Taf object.
If the string cannot be parsed as a valid TAF.
Parses a raw TAF string into a structured Taf object.
Handles both US (FAA) and ICAO format TAFs including FM, TEMPO, BECMG, and PROB change groups, wind shear (WS), turbulence (5-group), icing (6-group), CAVOK, NSW, and cancelled (CNL) forecasts.