Get metar from VATSIM for given ICAO airport code and display it in terminal.
For simulation use only!
You can use it as a CLI tool by installing it globally, or as a package in your project.
$ npm install -g @svantetic/metar
$ metar epkt
EPKT 141430Z 09010KT 060V140 CAVOK 21/02 Q1015
$ npm install -g @svantetic/metar
const { getMetar } = require('@svantetic/metar/api')
getMetar('epkt').then((metar) => {
// do stuff
});
// or
const epkt = await getMetar('epkt');
Package does not do additional validation or error handling. When there's no metar available or ICAO code is wrong, it will return empty string, just like VATSIM api.