UNPKG

metar-cli

Version:

A command line tool to get METARs based on ICAO codes

14 lines (9 loc) 343 B
const fetch = require('isomorphic-fetch'); function fetchMETAR(ICAOCode) { return fetch('https://avwx.rest/api/metar/' + ICAOCode).then(res => res.json()); } function fetchTAF(ICAOCode) { return fetch('https://avwx.rest/api/taf/' + ICAOCode).then(res => res.json()); } exports.fetchMETAR = fetchMETAR; exports.fetchTAF = fetchTAF;